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
8f9aa4dc
Commit
8f9aa4dc
authored
Jun 25, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_register
parents
34935434
d0500ecc
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
591 additions
and
329 deletions
+591
-329
EquipSourceEnum.java
...eejoin/amos/boot/module/jg/api/enums/EquipSourceEnum.java
+13
-0
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+1
-1
JgVehicleInformationMapper.java
...boot/module/jg/api/mapper/JgVehicleInformationMapper.java
+1
-1
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+0
-1
JgVehicleInformationMapper.xml
.../src/main/resources/mapper/JgVehicleInformationMapper.xml
+1
-2
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+18
-18
PieLineDataChangeServiceImpl.java
.../biz/edit/process/equip/PieLineDataChangeServiceImpl.java
+2
-0
EditEquipReminderAdapter.java
.../biz/reminder/biz/editEquip/EditEquipReminderAdapter.java
+2
-12
EditProjectReminderAdapter.java
.../reminder/biz/editProject/EditProjectReminderAdapter.java
+2
-7
NewEquipReminderAdapter.java
...jg/biz/reminder/biz/newEquip/NewEquipReminderAdapter.java
+4
-20
NewProjectReminderAdapter.java
...iz/reminder/biz/newProject/NewProjectReminderAdapter.java
+2
-12
UseRegisterReminderAdapter.java
.../reminder/biz/useRegister/UseRegisterReminderAdapter.java
+19
-61
VehicleInformationReminderAdapter.java
...vehicleInformation/VehicleInformationReminderAdapter.java
+8
-17
DefaultReminder.java
...mos/boot/module/jg/biz/reminder/core/DefaultReminder.java
+8
-17
IReminderHandler.java
...os/boot/module/jg/biz/reminder/core/IReminderHandler.java
+1
-1
ReminderFieldDiff.java
...s/boot/module/jg/biz/reminder/core/ReminderFieldDiff.java
+1
-1
CommonReminderService.java
...module/jg/biz/reminder/service/CommonReminderService.java
+3
-17
RemindServiceImpl.java
...oot/module/jg/biz/reminder/service/RemindServiceImpl.java
+1
-1
ReminderFieldDiffImpl.java
...module/jg/biz/reminder/service/ReminderFieldDiffImpl.java
+5
-3
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+1
-0
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+80
-47
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+161
-41
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+21
-6
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+63
-40
MemoryPageUtils.java
...eejoin/amos/boot/module/jg/biz/utils/MemoryPageUtils.java
+58
-0
EquipWaitRefreshDataQualityScore.java
.../module/ymt/api/dto/EquipWaitRefreshDataQualityScore.java
+13
-0
ProjectWaitRefreshDataQualityScore.java
...odule/ymt/api/dto/ProjectWaitRefreshDataQualityScore.java
+12
-0
RefreshDataDto.java
.../yeejoin/amos/boot/module/ymt/api/dto/RefreshDataDto.java
+25
-0
IdxBizJgProjectContraption.java
...oot/module/ymt/api/entity/IdxBizJgProjectContraption.java
+7
-1
IdxBizJgUseInfo.java
...join/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
+7
-0
IdxBizJgProjectContraptionMapper.java
...dule/ymt/api/mapper/IdxBizJgProjectContraptionMapper.java
+3
-0
IdxBizJgUseInfoMapper.java
...mos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
+10
-1
IdxBizJgProjectContraptionMapper.xml
...ain/resources/mapper/IdxBizJgProjectContraptionMapper.xml
+6
-1
IdxBizJgUseInfoMapper.xml
...t-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
+32
-0
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/enums/EquipSourceEnum.java
View file @
8f9aa4dc
...
...
@@ -54,4 +54,17 @@ public enum EquipSourceEnum {
return
EquipSourceEnum
.
jg_his
.
getName
();
}
}
public
static
String
getDataSourceType
(
String
dataSource
)
{
if
(
StringUtils
.
isEmpty
(
dataSource
)){
return
EquipSourceEnum
.
jg_his
.
getType
();
}
if
(
EquipSourceEnum
.
jg
.
getCode
().
equals
(
dataSource
)
||
(
dataSource
.
startsWith
(
EquipSourceEnum
.
jg
.
getCode
())
&&
!
dataSource
.
startsWith
(
EquipSourceEnum
.
jg_his
.
getCode
()))){
return
EquipSourceEnum
.
jg
.
getType
();
}
else
if
(
dataSource
.
startsWith
(
EquipSourceEnum
.
jg_his_black
.
getCode
())){
return
EquipSourceEnum
.
jg_his_black
.
getType
();
}
else
{
return
EquipSourceEnum
.
jg_his
.
getType
();
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
View file @
8f9aa4dc
...
...
@@ -130,6 +130,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Set
<
Long
>
queryListByEqsAndStatus
(
@Param
(
"records"
)
Set
<
String
>
records
,
@Param
(
"status"
)
String
status
,
@Param
(
"applyNo"
)
String
applyNo
);
Page
<
ReminderItemDto
>
queryForUnitVehiclePageForReminder
(
Page
<?>
page
,
@Param
(
"records"
)
List
<
String
>
records
);
List
<
ReminderItemDto
>
queryForUnitVehiclePageForReminder
(
@Param
(
"records"
)
List
<
String
>
records
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgVehicleInformationMapper.java
View file @
8f9aa4dc
...
...
@@ -54,5 +54,5 @@ public interface JgVehicleInformationMapper extends BaseMapper<JgVehicleInformat
List
<
Map
<
String
,
Object
>>
getVehicleInfoOfPassWithEquId
();
Page
<
ReminderItemDto
>
queryForUnitVehiclePageForReminder
(
Page
<
ReminderItemDto
>
page
,
List
<
String
>
records
);
List
<
ReminderItemDto
>
queryUnitVehiclesForReminderList
(
List
<
String
>
records
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
8f9aa4dc
...
...
@@ -1539,6 +1539,5 @@
<foreach
collection=
"records"
item=
"record"
open=
"("
close=
")"
separator=
","
>
#{record}
</foreach>
ORDER BY ri.REC_DATE DESC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgVehicleInformationMapper.xml
View file @
8f9aa4dc
...
...
@@ -351,7 +351,7 @@
AND u.estate_unit_credit_code is not null
ORDER BY u.audit_pass_date
</select>
<select
id=
"query
ForUnitVehiclePageForReminder
"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto"
>
<select
id=
"query
UnitVehiclesForReminderList
"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto"
>
SELECT
ri."PRODUCT_NAME" AS equipName,
fi."FACTORY_NUM" AS equipNo,
...
...
@@ -363,6 +363,5 @@
<foreach
collection=
"records"
item=
"record"
open=
"("
close=
")"
separator=
","
>
#{record}
</foreach>
ORDER BY ri.REC_DATE DESC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataHandlerController.java
View file @
8f9aa4dc
...
...
@@ -50,6 +50,7 @@ public class DataHandlerController extends BaseController {
/**
* 向新增的工程装置表刷入数据(补充使用单位code为空的)
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -61,9 +62,9 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"使用登记表属地监管部门历史数据处理"
,
notes
=
"supervisionOrgCode在history表json数据写入,气瓶导入页面无此字段,使用单位的属地监管部门写入"
)
@ApiOperation
(
value
=
"使用登记表属地监管部门历史数据处理"
,
notes
=
"supervisionOrgCode在history表json数据写入,气瓶导入页面无此字段,使用单位的属地监管部门写入"
)
@PutMapping
(
value
=
"/useRegistration/supervisionOrgCode"
)
public
ResponseModel
<
Boolean
>
writeSupervisionOrgCode2UseRegister
(){
public
ResponseModel
<
Boolean
>
writeSupervisionOrgCode2UseRegister
()
{
dataHandlerService
.
writeSupervisionOrgCode2UseRegister
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -72,7 +73,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"安装告知缺少装置id、装置未创建、安装告知完成但是设备状态为未纳管数据处理"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/notice"
)
public
ResponseModel
<
Boolean
>
projectContraptionNoticeDataDealV3
(){
public
ResponseModel
<
Boolean
>
projectContraptionNoticeDataDealV3
()
{
dataHandlerService
.
projectContraptionNoticeDataDeal
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -80,7 +81,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"使用登记缺少装置id数据处理"
,
notes
=
"历史数据处理,依赖/v3/projectContraption/notice作为基础数据"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/useRegister"
)
public
ResponseModel
<
Boolean
>
projectContraptionUseRegisterDataDealV3
(){
public
ResponseModel
<
Boolean
>
projectContraptionUseRegisterDataDealV3
()
{
dataHandlerService
.
projectContraptionUseRegisterDataDeal
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -88,7 +89,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"由于前期设备纳管状态不对,导致的1220上线时 创建的装置纳管状态不对,刷库"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v2/projectContraption/info"
)
public
ResponseModel
<
Boolean
>
projectContraptionInfoUpdateV2
(){
public
ResponseModel
<
Boolean
>
projectContraptionInfoUpdateV2
()
{
dataHandlerService
.
projectContraptionInfoUpdateV2
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -97,7 +98,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"20250108-刷管道,设备使用信息表装置id未更新,导致的错误数据处理,已es为准"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/useInfo"
)
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV3
(){
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV3
()
{
dataHandlerService
.
projectUseInfoUpdateV3
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -105,7 +106,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"20250108-1220上线时, 已完成安装告知管道未写入装置的施工信息表(导致使用登记不能回显施工信息),刷库"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/info"
)
public
ResponseModel
<
Boolean
>
projectContraptionInfoUpdateV3
(){
public
ResponseModel
<
Boolean
>
projectContraptionInfoUpdateV3
()
{
dataHandlerService
.
projectContraptionInfoUpdateV3
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -113,7 +114,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"20250109-之前刷库问题导致的管道的装置id与安装告知不一样,已安装告知为准,刷使用信息表的装置id、es的装置id【只处理未做过使用登记或者使用登记未完成的】"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v4/projectContraption/useInfo"
)
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV4
(){
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV4
()
{
dataHandlerService
.
projectUseInfoUpdateV4
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -121,7 +122,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"20250110-处理一个管道在多个安装告知里,刷管道的use_info、es的装置id,已最新安装告知为准"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v5/projectContraption/useInfo"
)
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV5
(){
public
ResponseModel
<
Boolean
>
projectUseInfoUpdateV5
()
{
dataHandlerService
.
projectUseInfoUpdateV5
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -181,7 +182,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"补充西安导入数据的使用信用代码,压力管道除外"
,
notes
=
"补充西安导入数据的使用信用代码,压力管道除外"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v1/xa/useInfo"
)
public
ResponseModel
<
Boolean
>
updateUseInfoOfCompanyV1
(){
public
ResponseModel
<
Boolean
>
updateUseInfoOfCompanyV1
()
{
dataHandlerService
.
updateUseInfoOfCompanyV1
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -189,7 +190,7 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"恢复单位变更数据"
,
notes
=
"恢复单位变更数据"
)
@GetMapping
(
value
=
"/restore"
)
public
ResponseModel
<
Boolean
>
restore
(){
public
ResponseModel
<
Boolean
>
restore
()
{
dataHandlerService
.
restore
();
return
ResponseHelper
.
buildResponse
(
true
);
}
...
...
@@ -198,7 +199,7 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"存量数据刷属地监管部门到证管理表"
,
notes
=
"存量数据刷属地监管部门到证管理表"
)
@PutMapping
(
value
=
"/supervise2UseRegManage"
)
public
ResponseModel
<
Long
>
saveSupervise2UseRegManage
(){
public
ResponseModel
<
Long
>
saveSupervise2UseRegManage
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
saveSupervise2UseRegManage
());
}
...
...
@@ -206,7 +207,7 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"历史安全追溯问题闭环【维保备案】【检验超期】"
,
notes
=
"历史安全追溯问题闭环【维保备案】【检验超期】"
)
@PutMapping
(
value
=
"/safeTraceabilityClosedLoop"
)
public
ResponseModel
<
String
>
safeTraceabilityClosedLoop
(){
public
ResponseModel
<
String
>
safeTraceabilityClosedLoop
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
safeTraceabilityClosedLoop
());
}
...
...
@@ -224,9 +225,7 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"put"
,
value
=
"历史设备装置初始化数据质量等级"
,
notes
=
"车用气瓶登记产权单位信息刷入useInfo表"
)
@PutMapping
(
value
=
"/initDataQualityScore"
)
public
ResponseModel
<
String
>
initDataQualityScore
(){
// todo
return
null
;
public
ResponseModel
<
String
>
initDataQualityScore
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
initDataQualityScore
());
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/PieLineDataChangeServiceImpl.java
View file @
8f9aa4dc
...
...
@@ -330,6 +330,8 @@ public class PieLineDataChangeServiceImpl {
private
Double
calTotalPieLineLength
(
String
projectContraptionId
)
{
List
<
String
>
records
=
useInfoService
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgUseInfo
>().
eq
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
projectContraptionId
).
select
(
IdxBizJgUseInfo:
:
getRecord
)).
stream
().
map
(
IdxBizJgUseInfo:
:
getRecord
).
collect
(
Collectors
.
toList
());
// 如果没有记录,直接返回 0.0
if
(
records
.
isEmpty
())
return
0.0
;
List
<
IdxBizJgTechParamsPipeline
>
techParamsPipelines
=
idxBizJgTechParamsPipelineService
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgTechParamsPipeline
>().
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
records
).
select
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
IdxBizJgTechParamsPipeline:
:
getPipeLength
));
return
techParamsPipelines
.
stream
().
filter
(
i
->
i
.
getPipeLength
()
!=
null
).
map
(
e
->
new
BigDecimal
(
e
.
getPipeLength
()))
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/editEquip/EditEquipReminderAdapter.java
View file @
8f9aa4dc
...
...
@@ -30,14 +30,6 @@ public class EditEquipReminderAdapter extends DefaultReminder {
this
.
editEquipParseService
=
editEquipParseService
;
}
@Override
public
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
ReminderItemDto
reminderItemDto
=
setRealTimeReminderItem
(
bizId
);
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
}
private
ReminderItemDto
setRealTimeReminderItem
(
String
bizId
)
{
IdxBizJgRegisterInfo
registerInfo
=
editEquipParseService
.
getIdxBizJgRegisterInfoService
().
getOne
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
bizId
).
select
(
IdxBizJgRegisterInfo:
:
getRecord
,
IdxBizJgRegisterInfo:
:
getProductName
));
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
...
...
@@ -53,7 +45,7 @@ public class EditEquipReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
IdxBizJgRegisterInfo
registerInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
formData
),
IdxBizJgRegisterInfo
.
class
);
IdxBizJgUseInfo
bizJgUseInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
formData
),
IdxBizJgUseInfo
.
class
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
...
...
@@ -61,9 +53,7 @@ public class EditEquipReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
bizJgUseInfo
.
getUseInnerCode
());
reminderItemDto
.
setEquipName
(
registerInfo
.
getProductName
());
reminderItemDto
.
setDetailData
(
formData
);
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
return
Collections
.
singletonList
(
reminderItemDto
);
}
@Override
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/editProject/EditProjectReminderAdapter.java
View file @
8f9aa4dc
...
...
@@ -29,11 +29,6 @@ public class EditProjectReminderAdapter extends DefaultReminder {
this
.
editProjectParseService
=
editProjectParseService
;
}
@Override
protected
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
// 创建后,详情使用
return
CommonReminderService
.
setProjectReminderItemPage
(
bizId
,
page
,
editProjectParseService
.
getIdxBizJgProjectContraptionServiceImpl
());
}
@Override
protected
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
...
...
@@ -43,10 +38,10 @@ public class EditProjectReminderAdapter extends DefaultReminder {
@Override
protected
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
protected
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
// 新增 + 编辑的保存使用
IdxBizJgProjectContraption
projectContraption
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
formData
),
IdxBizJgProjectContraption
.
class
);
return
CommonReminderService
.
setProjectReminderItemPageJson
(
bizId
,
p
age
,
p
rojectContraption
);
return
CommonReminderService
.
setProjectReminderItemPageJson
(
bizId
,
projectContraption
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/newEquip/NewEquipReminderAdapter.java
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
reminder
.
biz
.
newEquip
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.DefaultReminder
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.service.CommonReminderService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
...
...
@@ -16,6 +14,7 @@ import org.springframework.stereotype.Component;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
/**
* 设备/气瓶创建编辑-提醒处理器
*/
...
...
@@ -30,19 +29,6 @@ public class NewEquipReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
IdxBizJgRegisterInfo
registerInfo
=
newEquipParseService
.
getIdxBizJgRegisterInfoService
().
getOneData
(
bizId
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
reminderItemDto
.
setEquipId
(
bizId
);
reminderItemDto
.
setEquipNo
(
registerInfo
.
getEquCode
());
reminderItemDto
.
setEquipName
(
registerInfo
.
getProductName
());
reminderItemDto
.
setDetailData
(
newEquipParseService
.
getEquipDetailByRecord
(
bizId
));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
}
@Override
protected
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
IdxBizJgRegisterInfo
registerInfo
=
newEquipParseService
.
getIdxBizJgRegisterInfoService
().
getOneData
(
bizId
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
...
...
@@ -54,7 +40,7 @@ public class NewEquipReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
IdxBizJgRegisterInfo
registerInfo
=
CommonReminderService
.
geEquipInfoFromJson
(
formData
,
IdxBizJgRegisterInfo
.
class
);
IdxBizJgUseInfo
bizJgUseInfo
=
CommonReminderService
.
geEquipInfoFromJson
(
formData
,
IdxBizJgUseInfo
.
class
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
...
...
@@ -62,9 +48,7 @@ public class NewEquipReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
bizJgUseInfo
.
getUseInnerCode
());
reminderItemDto
.
setEquipName
(
registerInfo
.
getProductName
());
reminderItemDto
.
setDetailData
(
newEquipParseService
.
getDetailInfoFromJson
(
formData
));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
return
Collections
.
singletonList
(
reminderItemDto
);
}
@Override
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/newProject/NewProjectReminderAdapter.java
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
reminder
.
biz
.
newProject
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.DefaultReminder
;
...
...
@@ -30,12 +28,6 @@ public class NewProjectReminderAdapter extends DefaultReminder {
this
.
newProjectParseService
=
newProjectParseService
;
}
@Override
protected
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
// 创建后,详情使用
return
CommonReminderService
.
setProjectReminderItemPage
(
bizId
,
page
,
newProjectParseService
.
getIdxBizJgProjectContraptionServiceImpl
());
}
@Override
protected
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
...
...
@@ -44,7 +36,7 @@ public class NewProjectReminderAdapter extends DefaultReminder {
}
@Override
protected
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
protected
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
// 新增 + 编辑的保存使用
IdxBizJgProjectContraption
projectContraption
=
CommonReminderService
.
geEquipInfoFromJson
(
formData
,
IdxBizJgProjectContraption
.
class
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
...
...
@@ -52,9 +44,7 @@ public class NewProjectReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
reminderItemDto
.
setDetailData
(
BeanUtil
.
beanToMap
(
projectContraption
));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
return
Collections
.
singletonList
(
reminderItemDto
);
}
@Override
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/useRegister/UseRegisterReminderAdapter.java
View file @
8f9aa4dc
...
...
@@ -4,14 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.biz.vehicleInformation.VehicleInformationReminderAdapter
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.DefaultReminder
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.service.CommonReminderService
;
...
...
@@ -24,7 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Component
;
import
java.util.
Collections
;
import
java.util.
ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -46,7 +43,8 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
List
<
ReminderItemDto
>
re
=
new
ArrayList
<>();
// 创建后, 监管通过时使用
JgUseRegistration
useRegistration
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
selectById
(
bizId
);
// 压力管道
...
...
@@ -58,8 +56,7 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
reminderItemDto
.
setDetailData
(
this
.
buildProjectContraptionByStatus
(
useRegistration
,
useRegistration
.
getProjectContraptionId
()));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
re
.
add
(
reminderItemDto
);
}
// 气瓶
if
(
StringUtils
.
isEmpty
(
useRegistration
.
getProjectContraptionId
())
&&
"unit"
.
equals
(
useRegistration
.
getManageType
()))
{
...
...
@@ -67,8 +64,9 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
String
>
records
=
useRegisterReminderParse
.
getJgRelationEquipMapper
().
selectList
(
lambda
).
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Page
<
ReminderItemDto
>
mapPage
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
queryForUnitVehiclePageForReminder
(
page
,
records
);
mapPage
.
getRecords
().
forEach
(
item
->
item
.
setDetailData
(
this
.
buildSetUseDataByStatus
(
useRegistration
,
item
.
getEquipId
())));
List
<
ReminderItemDto
>
itemDtoList
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
queryForUnitVehiclePageForReminder
(
records
);
itemDtoList
.
forEach
(
item
->
item
.
setDetailData
(
this
.
buildSetUseDataByStatus
(
useRegistration
,
item
.
getEquipId
())));
re
.
addAll
(
itemDtoList
);
}
// 台套设备
if
(
StringUtils
.
isEmpty
(
useRegistration
.
getManageType
())
||
"set"
.
equals
(
useRegistration
.
getManageType
()))
{
...
...
@@ -86,49 +84,9 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
idxBizJgUseInfo
.
getUseInnerCode
());
reminderItemDto
.
setEquipName
(
registerInfo
.
getProductName
());
reminderItemDto
.
setDetailData
(
this
.
buildSetUseDataByStatus
(
useRegistration
,
record
));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
re
.
add
(
reminderItemDto
);
}
return
page
;
}
@Override
protected
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
// 创建后,评分使用
JgUseRegistration
useRegistration
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
selectById
(
bizId
);
// todo 气瓶时不显示评分,在列表上显示
// 压力管道
if
(
StringUtils
.
isNotEmpty
(
useRegistration
.
getProjectContraptionId
()))
{
String
projectContraptionId
=
useRegistration
.
getProjectContraptionId
();
IdxBizJgProjectContraption
projectContraption
=
useRegisterReminderParse
.
getIdxBizJgProjectContraptionServiceImpl
().
getById
(
projectContraptionId
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
reminderItemDto
.
setEquipId
(
projectContraptionId
);
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
// 区分单据状态
reminderItemDto
.
setDetailData
(
this
.
buildProjectContraptionByStatus
(
useRegistration
,
useRegistration
.
getProjectContraptionId
()));
return
Collections
.
singletonList
(
reminderItemDto
);
}
// 台套设备
if
(
StringUtils
.
isEmpty
(
useRegistration
.
getManageType
())
||
"set"
.
equals
(
useRegistration
.
getManageType
()))
{
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
useRegisterReminderParse
.
getJgRelationEquipMapper
().
selectList
(
lambda
);
String
record
=
eqList
.
iterator
().
next
().
getEquId
();
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
IdxBizJgRegisterInfo
registerInfo
=
useRegisterReminderParse
.
getIdxBizJgRegisterInfoMapper
().
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
)
.
select
(
IdxBizJgRegisterInfo:
:
getRecord
,
IdxBizJgRegisterInfo:
:
getProductName
));
IdxBizJgUseInfo
idxBizJgUseInfo
=
useRegisterReminderParse
.
getIdxBizJgUseInfoMapper
().
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgUseInfo
>().
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
)
.
select
(
IdxBizJgUseInfo:
:
getRecord
,
IdxBizJgUseInfo:
:
getUseInnerCode
));
reminderItemDto
.
setEquipId
(
record
);
reminderItemDto
.
setEquipNo
(
idxBizJgUseInfo
.
getUseInnerCode
());
reminderItemDto
.
setEquipName
(
registerInfo
.
getProductName
());
reminderItemDto
.
setDetailData
(
this
.
buildSetUseDataByStatus
(
useRegistration
,
record
));
return
Collections
.
singletonList
(
reminderItemDto
);
}
return
Collections
.
emptyList
();
return
re
;
}
private
Map
<
String
,
Object
>
buildSetUseDataByStatus
(
JgUseRegistration
useRegistration
,
String
record
)
{
...
...
@@ -158,19 +116,21 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
List
<
ReminderItemDto
>
re
=
new
ArrayList
<>();
JSONObject
data
=
getSummitDataFromJson
(
formData
);
String
manageType
=
data
.
getString
(
"manageType"
);
if
(
StringUtils
.
isNotEmpty
(
manageType
)
&&
"unit"
.
equals
(
manageType
))
{
// 单位办理方式
String
equListCode
=
data
.
getString
(
"EQU_LIST_CODE"
);
// 气瓶--气瓶分页
// 气瓶--气瓶分页
->调整为按照使用登记证维度(此处未修改,只是把规则表进行修改,防止后期又调整为按照气瓶进行缺项)
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
formData
.
get
(
"EQU_CATEGORY_CODE"
)))
{
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
data
.
get
(
"equipmentLists"
);
List
<
String
>
records
=
equipmentLists
.
stream
().
map
(
item
->
item
.
get
(
"record"
).
toString
()).
collect
(
Collectors
.
toList
());
Page
<
ReminderItemDto
>
mapPage
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
queryForUnitVehiclePageForReminder
(
page
,
records
);
mapPage
.
getRecords
()
.
forEach
(
item
->
{
List
<
ReminderItemDto
>
itemDtoList
=
useRegisterReminderParse
.
getJgUseRegistrationMapper
().
queryForUnitVehiclePageForReminder
(
records
);
itemDtoList
.
forEach
(
item
->
{
item
.
setDetailData
(
data
);
});
re
.
addAll
(
itemDtoList
);
}
// 压力管道--装置
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
))
{
...
...
@@ -181,8 +141,7 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
reminderItemDto
.
setDetailData
(
data
);
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
re
.
add
(
reminderItemDto
);
}
}
else
{
// 台套方式
String
record
=
data
.
getString
(
"equipId"
);
...
...
@@ -191,10 +150,9 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
reminderItemDto
.
setEquipNo
(
data
.
getString
(
"useInnerCode"
));
reminderItemDto
.
setEquipName
(
data
.
getString
(
"productName"
));
reminderItemDto
.
setDetailData
(
data
);
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
re
.
add
(
reminderItemDto
);
}
return
pag
e
;
return
r
e
;
}
private
static
JSONObject
getSummitDataFromJson
(
Map
<
String
,
Object
>
formData
)
{
...
...
@@ -203,7 +161,7 @@ public class UseRegisterReminderAdapter extends DefaultReminder {
if
(
formData
.
containsKey
(
notice
))
{
// 新增登记工作台发起
data
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
formData
.
get
(
notice
)));
data
.
put
(
"regType"
,
"0"
);
}
else
if
(
formData
.
containsKey
(
SECOND
)
)
{
// 历史有证、无证登记
}
else
if
(
formData
.
containsKey
(
SECOND
))
{
// 历史有证、无证登记
data
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
formData
.
get
(
SECOND
)));
String
regType
=
data
.
getString
(
KEY_REG_TYPE
);
data
.
put
(
"regType"
,
regType
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/biz/vehicleInformation/VehicleInformationReminderAdapter.java
View file @
8f9aa4dc
...
...
@@ -4,8 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgVehicleInformation
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgVehicleInformationEq
;
...
...
@@ -17,7 +15,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Component
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -39,24 +36,18 @@ public class VehicleInformationReminderAdapter extends DefaultReminder {
}
@Override
public
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
// 创建后, 监管通过时使用
JgVehicleInformation
vehicleInformation
=
vehicleInformationReminderParse
.
getVehicleInformationMapper
().
selectById
(
bizId
);
LambdaQueryWrapper
<
JgVehicleInformationEq
>
lambda
=
new
QueryWrapper
<
JgVehicleInformationEq
>().
lambda
();
lambda
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
lambda
.
select
(
JgVehicleInformationEq:
:
getEquId
);
List
<
String
>
records
=
vehicleInformationReminderParse
.
getVehicleInformationEqMapper
().
selectList
(
lambda
).
stream
().
map
(
JgVehicleInformationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Page
<
ReminderItemDto
>
mapPage
=
vehicleInformationReminderParse
.
getVehicleInformationMapper
().
queryForUnitVehiclePageForReminder
(
page
,
records
);
mapPage
.
getRecords
()
.
forEach
(
item
->
item
.
setDetailData
(
this
.
buildCompareData
(
vehicleInformation
,
item
.
getEquipId
())));
return
page
;
List
<
ReminderItemDto
>
itemDtoList
=
vehicleInformationReminderParse
.
getVehicleInformationMapper
().
queryUnitVehiclesForReminderList
(
records
);
itemDtoList
.
forEach
(
item
->
item
.
setDetailData
(
this
.
buildCompareData
(
vehicleInformation
,
item
.
getEquipId
())));
return
itemDtoList
;
}
@Override
protected
List
<
ReminderItemDto
>
realtimeParse
(
String
bizId
)
{
// 创建后,评分使用
// todo 气瓶时不显示评分,在列表上显示
return
Collections
.
emptyList
();
}
private
Map
<
String
,
Object
>
buildCompareData
(
JgVehicleInformation
vehicleInformation
,
String
record
)
{
Map
<
String
,
Object
>
re
=
BeanUtil
.
beanToMap
(
vehicleInformation
);
...
...
@@ -72,14 +63,14 @@ public class VehicleInformationReminderAdapter extends DefaultReminder {
@Override
public
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
)
{
public
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
// 气瓶--气瓶分页
JSONObject
data
=
getSummitDataFromJson
(
formData
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
data
.
get
(
"equipmentLists"
);
List
<
String
>
records
=
equipmentLists
.
stream
().
map
(
item
->
item
.
get
(
"record"
).
toString
()).
collect
(
Collectors
.
toList
());
Page
<
ReminderItemDto
>
mapPage
=
vehicleInformationReminderParse
.
getVehicleInformationMapper
().
queryForUnitVehiclePageForReminder
(
page
,
records
);
mapPage
.
getRecords
().
forEach
(
item
->
item
.
setDetailData
(
this
.
buildCompareData
(
data
,
item
.
getEquipId
())));
return
p
age
;
List
<
ReminderItemDto
>
mapPage
=
vehicleInformationReminderParse
.
getVehicleInformationMapper
().
queryUnitVehiclesForReminderList
(
records
);
mapPage
.
forEach
(
item
->
item
.
setDetailData
(
this
.
buildCompareData
(
data
,
item
.
getEquipId
())));
return
mapP
age
;
}
private
static
JSONObject
getSummitDataFromJson
(
Map
<
String
,
Object
>
formData
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/core/DefaultReminder.java
View file @
8f9aa4dc
...
...
@@ -2,9 +2,9 @@ package com.yeejoin.amos.boot.module.jg.biz.reminder.core;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.biz.factory.GradeStrategyFactory
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
org.springframework.context.ApplicationContext
;
import
java.util.List
;
...
...
@@ -18,13 +18,13 @@ public abstract class DefaultReminder implements IReminderHandler {
}
@Override
public
IPage
<
ReminderItemDto
>
remindersPage
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
)
{
IPage
<
ReminderItemDto
>
params
=
parse
(
page
,
bizId
,
sourceType
,
formData
);
public
IPage
<
ReminderItemDto
>
getReminderList
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
)
{
List
<
ReminderItemDto
>
params
=
parse
(
bizId
,
sourceType
,
formData
);
ReminderFieldDiff
reminderFieldDiff
=
applicationContext
.
getBean
(
ReminderFieldDiff
.
class
);
MatchItemDto
matchItemDto
=
setMatchItemBySourceType
(
sourceType
,
bizId
,
formData
);
matchItemDto
.
setBizType
(
supportBizType
());
matchItemDto
.
setPage
(
page
);
return
reminderFieldDiff
.
getReminderItemsPage
(
params
,
matchItemDto
);
return
reminderFieldDiff
.
getReminderItemsPage
(
params
,
page
,
matchItemDto
);
}
private
MatchItemDto
setMatchItemBySourceType
(
SourceType
sourceType
,
String
bizId
,
Map
<
String
,
Object
>
formData
)
{
...
...
@@ -46,25 +46,17 @@ public abstract class DefaultReminder implements IReminderHandler {
return
strategyFactory
.
getStrategy
(
activeStrategy
).
calculateGrade
(
realtimeParse
(
bizId
),
matchItemDto
);
}
private
IPage
<
ReminderItemDto
>
parse
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
)
{
private
List
<
ReminderItemDto
>
parse
(
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
)
{
switch
(
sourceType
)
{
case
realTime:
return
realtimeParse
(
bizId
,
page
);
return
realtimeParse
(
bizId
);
case
json:
return
jsonParse
(
bizId
,
formData
,
page
);
return
jsonParse
(
bizId
,
formData
);
default
:
throw
new
RuntimeException
(
"no support type for "
+
sourceType
);
}
}
/**
* 获取指定分页的设备、装置、单据下的设备、管道,详情使用
*
* @param bizId 唯一标识
* @return 分页的设备/管道
*/
protected
abstract
IPage
<
ReminderItemDto
>
realtimeParse
(
String
bizId
,
Page
<
ReminderItemDto
>
page
);
/**
* 获取指定设备、装置、单据下的设备、管道列表-评分使用;台套-台套设备;气瓶-气瓶;装置-装置
...
...
@@ -80,10 +72,9 @@ public abstract class DefaultReminder implements IReminderHandler {
*
* @param bizId 唯一标识
* @param formData 表单数据
* @param page 分页信息
* @return 解析后的分页数据
*/
protected
abstract
IPage
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
,
Page
<
ReminderItemDto
>
page
);
protected
abstract
List
<
ReminderItemDto
>
jsonParse
(
String
bizId
,
Map
<
String
,
Object
>
formData
);
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/core/IReminderHandler.java
View file @
8f9aa4dc
...
...
@@ -8,7 +8,7 @@ import java.util.Map;
public
interface
IReminderHandler
{
IPage
<
ReminderItemDto
>
remindersPage
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
);
IPage
<
ReminderItemDto
>
getReminderList
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
);
Integer
getReminderLevel
(
String
bizId
,
String
activeStrategy
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/core/ReminderFieldDiff.java
View file @
8f9aa4dc
...
...
@@ -7,7 +7,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto;
import
java.util.List
;
public
interface
ReminderFieldDiff
{
IPage
<
ReminderItemDto
>
getReminderItemsPage
(
IPage
<
ReminderItemDto
>
equips
,
MatchItemDto
matchItem
);
IPage
<
ReminderItemDto
>
getReminderItemsPage
(
List
<
ReminderItemDto
>
params
,
IPage
<
ReminderItemDto
>
equips
,
MatchItemDto
matchItem
);
List
<
ReminderItemDto
>
getReminderItemList
(
List
<
ReminderItemDto
>
equips
,
MatchItemDto
matchItem
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/service/CommonReminderService.java
View file @
8f9aa4dc
...
...
@@ -4,8 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto
;
...
...
@@ -82,19 +80,9 @@ public class CommonReminderService {
matchItemDto
.
setEquDefine
(
registerInfo
.
getEquDefine
());
}
public
static
IPage
<
ReminderItemDto
>
setProjectReminderItemPage
(
String
bizId
,
Page
<
ReminderItemDto
>
page
,
IdxBizJgProjectContraptionServiceImplService
idxBizJgProjectContraptionServiceImpl
)
{
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionServiceImpl
.
getById
(
bizId
);
return
setProjectReminderItemPageJson
(
bizId
,
page
,
projectContraption
);
}
public
static
List
<
ReminderItemDto
>
setProjectReminderItemRealTime
(
String
bizId
,
IdxBizJgProjectContraptionServiceImplService
idxBizJgProjectContraptionServiceImpl
)
{
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionServiceImpl
.
getById
(
bizId
);
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
reminderItemDto
.
setEquipId
(
bizId
);
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
reminderItemDto
.
setDetailData
(
BeanUtil
.
beanToMap
(
projectContraption
));
return
Collections
.
singletonList
(
reminderItemDto
);
return
setProjectReminderItemPageJson
(
bizId
,
projectContraption
);
}
public
static
MatchItemDto
setMatchItemForProject
(
MatchItemDto
matchItemDto
,
IdxBizJgProjectContraption
projectContraption
)
{
...
...
@@ -123,15 +111,13 @@ public class CommonReminderService {
return
re
;
}
public
static
IPage
<
ReminderItemDto
>
setProjectReminderItemPageJson
(
String
bizId
,
Page
<
ReminderItemDto
>
page
,
IdxBizJgProjectContraption
projectContraption
)
{
public
static
List
<
ReminderItemDto
>
setProjectReminderItemPageJson
(
String
bizId
,
IdxBizJgProjectContraption
projectContraption
)
{
ReminderItemDto
reminderItemDto
=
new
ReminderItemDto
();
reminderItemDto
.
setEquipId
(
bizId
);
reminderItemDto
.
setEquipNo
(
projectContraption
.
getProjectContraptionNo
());
reminderItemDto
.
setEquipName
(
projectContraption
.
getProjectContraption
());
reminderItemDto
.
setDetailData
(
BeanUtil
.
beanToMap
(
projectContraption
));
page
.
setRecords
(
Collections
.
singletonList
(
reminderItemDto
));
page
.
setTotal
(
1L
);
return
page
;
return
Collections
.
singletonList
(
reminderItemDto
);
}
public
void
setEquCateInfoForEdit
(
String
record
,
MatchItemDto
matchItemDto
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/service/RemindServiceImpl.java
View file @
8f9aa4dc
...
...
@@ -22,7 +22,7 @@ public class RemindServiceImpl {
private
final
ReminderFactory
reminderFactory
;
public
IPage
<
ReminderItemDto
>
getReminderItems
(
Page
<
ReminderItemDto
>
page
,
String
bizId
,
String
bizType
,
IReminderHandler
.
SourceType
sourceType
,
Map
<
String
,
Object
>
formData
)
{
return
reminderFactory
.
getReminderHandler
(
bizType
).
remindersPage
(
page
,
StringUtils
.
isEmpty
(
bizId
)
?
null
:
bizId
,
sourceType
,
formData
);
return
reminderFactory
.
getReminderHandler
(
bizType
).
getReminderList
(
page
,
StringUtils
.
isEmpty
(
bizId
)
?
null
:
bizId
,
sourceType
,
formData
);
}
public
Integer
getReminderLevel
(
String
bizId
,
String
bizType
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/service/ReminderFieldDiffImpl.java
View file @
8f9aa4dc
...
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.TzsJgColumnReminderRule;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.ReminderFieldDiff
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.TzsJgColumnReminderRuleServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.MemoryPageUtils
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -26,11 +27,12 @@ public class ReminderFieldDiffImpl implements ReminderFieldDiff {
private
final
TzsJgColumnReminderRuleServiceImpl
reminderRuleService
;
@Override
public
IPage
<
ReminderItemDto
>
getReminderItemsPage
(
IPage
<
ReminderItemDto
>
page
,
MatchItemDto
matchItem
)
{
page
.
getRecords
()
.
forEach
(
reminderItemDto
->
{
public
IPage
<
ReminderItemDto
>
getReminderItemsPage
(
List
<
ReminderItemDto
>
reminderItemDtos
,
IPage
<
ReminderItemDto
>
page
,
MatchItemDto
matchItem
)
{
reminderItemDtos
.
forEach
(
reminderItemDto
->
{
reminderItemDto
.
setItems
(
this
.
buildRemindItem
(
reminderItemDto
,
matchItem
));
});
return
page
;
List
<
ReminderItemDto
>
itemDtoListMissing
=
reminderItemDtos
.
stream
().
filter
(
item
->
!
item
.
getItems
().
isEmpty
()).
collect
(
Collectors
.
toList
());
return
MemoryPageUtils
.
paginate
(
itemDtoListMissing
,
page
.
getCurrent
(),
page
.
getSize
());
}
@Override
...
...
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 @
8f9aa4dc
...
...
@@ -1471,6 +1471,7 @@ public class CommonServiceImpl implements ICommonService {
Map
<
String
,
Object
>
useRegFormUploadObj
=
(
Map
<
String
,
Object
>)
map
.
get
(
useRegFormUpload
);
String
uploadMode
=
String
.
valueOf
(
useRegFormUploadObj
.
get
(
"uploadMode"
));
jsonObject
.
put
(
"historySubmitType"
,
historySubmitType
);
jsonObject
.
put
(
"historyEquType"
,
historyEquType
);
Map
<
String
,
Function
<
JSONObject
,
Object
>>
handlerMap
=
new
HashMap
<>();
handlerMap
.
put
(
"unit"
,
jgUseRegistrationServiceImpl:
:
handleUnitHistoryEquip
);
...
...
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 @
8f9aa4dc
...
...
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
...
...
@@ -40,7 +41,9 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils
;
...
...
@@ -60,6 +63,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.stereotype.Service
;
...
...
@@ -70,6 +74,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.InputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.Timestamp
;
...
...
@@ -80,6 +85,7 @@ import java.util.concurrent.CompletableFuture;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
IdxBizJgRegisterInfoServiceImpl
.
toCamelCase
;
...
...
@@ -152,6 +158,9 @@ public class DataDockServiceImpl {
// 模版上传集合
public
static
final
String
EQU_LISTS
=
"equLists"
;
@Autowired
private
EventPublisher
eventPublisher
;
/**
* 西安数据对接-保存设备信息
*
...
...
@@ -164,19 +173,22 @@ public class DataDockServiceImpl {
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
String
token
=
RequestContext
.
getToken
();
Set
<
String
>
recordSet
=
new
HashSet
<>();
CompletableFuture
.
allOf
(
equLists
.
parallelStream
().
map
(
equ
->
CompletableFuture
.
runAsync
(()
->
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
saveEquipmentDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
String
record
=
saveEquipmentDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
recordSet
.
add
(
record
);
})).
toArray
(
CompletableFuture
[]::
new
)
).
join
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
Boolean
.
TRUE
;
}
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveEquipmentDataInTransaction
(
Map
<
String
,
Object
>
equ
,
String
dataSource
,
String
remark
)
{
public
String
saveEquipmentDataInTransaction
(
Map
<
String
,
Object
>
equ
,
String
dataSource
,
String
remark
)
{
String
record
=
UUID
.
randomUUID
().
toString
();
try
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
...
...
@@ -201,7 +213,7 @@ public class DataDockServiceImpl {
saveTechParams
(
equ
,
record
,
equList
);
// 保存到ES
saveEquInfoToEs
(
record
,
isCompleteXa
);
// return null
;
return
record
;
// });
}
catch
(
Exception
e
)
{
esEquipmentCategory
.
deleteById
(
record
);
...
...
@@ -356,6 +368,7 @@ public class DataDockServiceImpl {
useInfo
.
setLongitudeLatitude
(
String
.
format
(
"{\"latitude\":\"%s\",\"longitude\":\"%s\"}"
,
latitude
,
longitude
));
}
useInfo
.
setRecDate
(
new
Date
());
useInfo
.
setCreateDate
(
new
Date
());
useInfo
.
setRecord
(
record
);
useInfo
.
setDataSource
(
dataSource
);
useInfo
.
setIsNotEs
(
"1"
);
...
...
@@ -1593,32 +1606,32 @@ public class DataDockServiceImpl {
try
{
log
.
info
(
"解析第{}行数据:{}"
,
rowIndex
,
JSON
.
toJSONString
(
data
));
checkNotBlank
(
data
.
getPipeName
(),
"管道名称不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getDesignUnitCreditCode
(),
"设计单位统一社会信用代码不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getDesignUnitName
(),
"设计单位名称不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getInspectOrgCode
(),
"检验检测机构统一社会信用代码不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getInspectOrgName
(),
"检验检测机构名称不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getInspectConclusion
(),
"检验结论不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getInspectType
(),
"检验类型不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getInspectDate
(),
"检验日期不能为空;"
,
rowError
);
Optional
.
ofNullable
(
data
.
getInspectDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"检验日期格式不正确;"
,
rowError
));
checkNotBlank
(
data
.
getInspectStaff
(),
"检验人员名称不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getNextInspectDate
(),
"下次检验日期不能为空;"
,
rowError
);
Optional
.
ofNullable
(
data
.
getNextInspectDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"下次检验日期格式不正确;"
,
rowError
));
checkNotBlank
(
data
.
getInspectReportNo
(),
"检验报告编号不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getUscUnitCreditCode
(),
"安装单位统一社会信用代码不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getUscUnitName
(),
"安装单位名称不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getUscDate
(),
"安装年月不能为空"
,
rowError
);
//
checkNotBlank(data.getDesignUnitCreditCode(), "设计单位统一社会信用代码不能为空;", rowError);
//
checkNotBlank(data.getDesignUnitName(), "设计单位名称不能为空;", rowError);
//
checkNotBlank(data.getInspectOrgCode(), "检验检测机构统一社会信用代码不能为空;", rowError);
//
checkNotBlank(data.getInspectOrgName(), "检验检测机构名称不能为空;", rowError);
//
checkNotBlank(data.getInspectConclusion(), "检验结论不能为空;", rowError);
//
checkNotBlank(data.getInspectType(), "检验类型不能为空;", rowError);
//
checkNotBlank(data.getInspectDate(), "检验日期不能为空;", rowError);
//
Optional.ofNullable(data.getInspectDate()).ifPresent(v -> checkDateFormatCorrect(v, "检验日期格式不正确;", rowError));
//
checkNotBlank(data.getInspectStaff(), "检验人员名称不能为空;", rowError);
//
checkNotBlank(data.getNextInspectDate(), "下次检验日期不能为空;", rowError);
//
Optional.ofNullable(data.getNextInspectDate()).ifPresent(v -> checkDateFormatCorrect(v, "下次检验日期格式不正确;", rowError));
//
checkNotBlank(data.getInspectReportNo(), "检验报告编号不能为空;", rowError);
//
checkNotBlank(data.getUscUnitCreditCode(), "安装单位统一社会信用代码不能为空;", rowError);
//
checkNotBlank(data.getUscUnitName(), "安装单位名称不能为空;", rowError);
//
checkNotBlank(data.getUscDate(), "安装年月不能为空", rowError);
// 技术参数
checkNotBlank
(
data
.
getWallThickness
(),
"公称壁厚不能为空;"
,
rowError
);
Optional
.
ofNullable
(
data
.
getWallThickness
()).
ifPresent
(
item
->
checkPipeSpecifications
(
item
,
"公称壁厚请输入数字或者/分割的范围,如2/6;"
,
rowError
));
checkNotBlank
(
data
.
getNominalDiameter
(),
"公称直径不能为空;"
,
rowError
);
Optional
.
ofNullable
(
data
.
getNominalDiameter
()).
ifPresent
(
item
->
checkPipeSpecifications
(
item
,
"公称直径请输入数字或者/分割的范围,如2/6;"
,
rowError
));
checkNotBlank
(
data
.
getPipeLength
(),
"管道长度不能为空;"
,
rowError
);
Optional
.
ofNullable
(
data
.
getPipeLength
()).
ifPresent
(
item
->
checkDateFormatNumber
(
item
,
"管道长度必须为数字"
,
rowError
));
checkNotBlank
(
data
.
getPressure
(),
"设计-压力不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getMedium
(),
"设计-介质不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getTemperature
(),
"设计-温度不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getPipelineNumber
(),
"管道编号不能为空;"
,
rowError
);
//
checkNotBlank(data.getWallThickness(), "公称壁厚不能为空;", rowError);
//
Optional.ofNullable(data.getWallThickness()).ifPresent(item -> checkPipeSpecifications(item, "公称壁厚请输入数字或者/分割的范围,如2/6;", rowError));
//
checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError);
//
Optional.ofNullable(data.getNominalDiameter()).ifPresent(item -> checkPipeSpecifications(item, "公称直径请输入数字或者/分割的范围,如2/6;", rowError));
//
checkNotBlank(data.getPipeLength(), "管道长度不能为空;", rowError);
//
Optional.ofNullable(data.getPipeLength()).ifPresent(item -> checkDateFormatNumber(item, "管道长度必须为数字", rowError));
//
checkNotBlank(data.getPressure(), "设计-压力不能为空;", rowError);
//
checkNotBlank(data.getMedium(), "设计-介质不能为空;", rowError);
//
checkNotBlank(data.getTemperature(), "设计-温度不能为空;", rowError);
//
checkNotBlank(data.getPipelineNumber(), "管道编号不能为空;", rowError);
Optional
.
ofNullable
(
data
.
getPipelineNumber
()).
ifPresent
(
v
->
{
if
(
pipelineNumList
.
contains
(
v
))
{
rowError
.
append
(
"管道编号不能重复"
);
...
...
@@ -1626,7 +1639,7 @@ public class DataDockServiceImpl {
pipelineNumList
.
add
(
v
);
}
});
checkNotBlank
(
data
.
getDeviceLevel
(),
"管道级别不能为空;"
,
rowError
);
//
checkNotBlank(data.getDeviceLevel(), "管道级别不能为空;", rowError);
// 工业管道校验使用信息
...
...
@@ -1725,6 +1738,9 @@ public class DataDockServiceImpl {
this
.
checkTheUnitProConAlreadyExists
(
paramsDto
);
// 生成工程装置表信息
IdxBizJgProjectContraption
proCon
=
this
.
saveProjectContraption
(
paramsDto
);
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
Sets
.
newHashSet
(
proCon
.
toString
()),
EquipCreateOrEditEvent
.
EquipType
.
project
));
// 保存管道对应的idx表数据
List
<
String
>
records
=
this
.
savePipInfoToIdxTables
(
equLists
,
paramsDto
,
proCon
);
if
(
isGYGD
)
{
...
...
@@ -1829,20 +1845,20 @@ public class DataDockServiceImpl {
AgencyUserModel
userModel
=
reginParams
.
getUserModel
();
CompanyBo
company
=
reginParams
.
getCompany
();
String
orgBranchCode
=
equipInfo
.
getString
(
"orgBranchCode"
);
String
equListCode
=
String
.
valueOf
(
equipInfo
.
get
(
"EQU_LIST"
)
);
String
equCategoryCode
=
String
.
valueOf
(
equipInfo
.
get
(
"EQU_CATEGORY"
)
);
String
equDefineCode
=
String
.
valueOf
(
equipInfo
.
get
(
"EQU_DEFINE"
)
);
String
equListCode
=
Objects
.
toString
(
equipInfo
.
get
(
"EQU_LIST"
),
null
);
String
equCategoryCode
=
Objects
.
toString
(
equipInfo
.
get
(
"EQU_CATEGORY"
),
null
);
String
equDefineCode
=
Objects
.
toString
(
equipInfo
.
get
(
"EQU_DEFINE"
),
null
);
String
receiveOrgCode
=
Optional
.
ofNullable
(
equipInfo
.
get
(
"RECEIVE_ORG_CODE"
)).
map
(
String:
:
valueOf
).
orElse
(
null
);
String
inspectUnitCreditCode
=
Optional
.
ofNullable
(
equLists
.
get
(
0
).
getInspectOrgCode
()).
orElse
(
""
);
String
inspectUnitName
=
Optional
.
ofNullable
(
equLists
.
get
(
0
).
getInspectOrgName
()).
orElse
(
""
);
String
inspectUnitCreditCode
=
Optional
.
ofNullable
(
equLists
.
get
(
0
).
getInspectOrgCode
()).
orElse
(
null
);
String
inspectUnitName
=
Optional
.
ofNullable
(
equLists
.
get
(
0
).
getInspectOrgName
()).
orElse
(
null
);
String
useOrgCode
=
Optional
.
ofNullable
(
equipInfo
.
get
(
"USE_ORG_CODE"
)).
map
(
String:
:
valueOf
).
orElse
(
null
);
String
province
=
String
.
valueOf
(
equipInfo
.
get
(
"province"
)
);
String
city
=
String
.
valueOf
(
equipInfo
.
get
(
"city"
)
);
String
county
=
String
.
valueOf
(
equipInfo
.
get
(
"county"
)
);
String
street
=
String
.
valueOf
(
equipInfo
.
get
(
"street"
)
);
String
address
=
String
.
valueOf
(
equipInfo
.
get
(
"address"
)
);
String
usePlace
=
String
.
valueOf
(
equipInfo
.
get
(
"usePlace"
)
);
String
useDate
=
String
.
valueOf
(
equipInfo
.
get
(
"useDate"
)
);
String
province
=
Objects
.
toString
(
equipInfo
.
get
(
"province"
),
null
);
String
city
=
Objects
.
toString
(
equipInfo
.
get
(
"city"
),
null
);
String
county
=
Objects
.
toString
(
equipInfo
.
get
(
"county"
),
null
);
String
street
=
Objects
.
toString
(
equipInfo
.
get
(
"street"
),
null
);
String
address
=
Objects
.
toString
(
equipInfo
.
get
(
"address"
),
null
);
String
usePlace
=
Objects
.
toString
(
equipInfo
.
get
(
"usePlace"
),
null
);
String
useDate
=
Objects
.
toString
(
equipInfo
.
get
(
"useDate"
),
null
);
return
new
EquipRequestParamsDto
().
setCompanyCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
0
])
.
setProvince
(
province
)
.
setProvinceName
(
"陕西省"
)
...
...
@@ -1868,7 +1884,7 @@ public class DataDockServiceImpl {
.
setOrgBranchCode
(
orgBranchCode
.
split
(
"_"
).
length
>
1
?
orgBranchCode
.
split
(
"_"
)[
0
]
:
""
)
.
setOrgBranchName
(
orgBranchCode
.
split
(
"_"
).
length
>
1
?
orgBranchCode
.
split
(
"_"
)[
1
]
:
""
)
.
setUseOrgCode
(
useOrgCode
)
.
setVehicleApanage
(
String
.
valueOf
(
equipInfo
.
get
(
"VEHICLE_APANAGE"
)
))
.
setVehicleApanage
(
Objects
.
toString
(
equipInfo
.
get
(
"VEHICLE_APANAGE"
),
""
))
.
setReceiveOrgCode
(
Optional
.
ofNullable
(
receiveOrgCode
)
.
map
(
code
->
code
.
split
(
"_"
))
.
filter
(
parts
->
parts
.
length
>
0
)
...
...
@@ -1879,12 +1895,23 @@ public class DataDockServiceImpl {
.
filter
(
parts
->
parts
.
length
>
1
)
.
map
(
parts
->
parts
[
1
])
.
orElse
(
null
))
.
setProjectContraption
(
String
.
valueOf
(
equipInfo
.
get
(
"PROJECT_CONTRAPTION"
)
))
.
setProjectContraptionNo
(
String
.
valueOf
(
equipInfo
.
get
(
"PROJECT_CONTRAPTION_NO"
)
))
.
setProjectContraption
(
Objects
.
toString
(
equipInfo
.
get
(
"PROJECT_CONTRAPTION"
),
null
))
.
setProjectContraptionNo
(
Objects
.
toString
(
equipInfo
.
get
(
"PROJECT_CONTRAPTION_NO"
),
null
))
.
setProductPhoto
(
toJSONString
(
equipInfo
.
get
(
"PRODUCT_PHOTO"
)))
.
setProductQualificationCertificate
(
toJSONString
(
equipInfo
.
get
(
"PRODUCT_QUALIFICATION_CERTIFICATE"
)))
.
setOtherAccessories
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"OTHER_ACCESSORIES"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"OTHER_ACCESSORIES"
)))
.
setPipelineLength
(
equLists
.
stream
().
mapToDouble
(
item
->
Double
.
parseDouble
(
item
.
getPipeLength
())).
sum
())
.
setPipelineLength
(
Optional
.
ofNullable
(
equLists
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
PipingExcelDto:
:
getPipeLength
)
.
filter
(
Objects:
:
nonNull
)
.
map
(
String:
:
trim
)
.
filter
(
s
->
!
s
.
isEmpty
())
.
mapToDouble
(
Double:
:
parseDouble
)
.
sum
()
)
.
setInspectUnitCreditCode
(
inspectUnitCreditCode
)
.
setInspectUnitName
(
inspectUnitName
)
.
setStartLatitudeLongitude
(
toJSONString
(
equipInfo
.
get
(
"startLatitudeLongitude"
)))
...
...
@@ -1972,6 +1999,7 @@ public class DataDockServiceImpl {
useInfo
.
setRecord
(
record
);
useInfo
.
setSequenceNbr
(
null
);
useInfo
.
setRecDate
(
new
Date
());
useInfo
.
setCreateDate
(
new
Date
());
useInfo
.
setDataSource
(
paramsDto
.
getDataSource
());
useInfo
.
setIsIntoManagement
(
Boolean
.
TRUE
);
useInfo
.
setEquState
(
EquimentEnum
.
ZAIYONG
.
getCode
().
toString
());
...
...
@@ -2349,6 +2377,7 @@ public class DataDockServiceImpl {
.
endLatitudeLongitude
(
paramsDto
.
getEndLatitudeLongitude
())
.
supervisoryCode
(
idxBizJgRegisterInfoServiceImpl
.
getSupervisoryCode
(
paramsDto
.
getVehicleApanage
(),
paramsDto
.
getEquCategoryCode
())).
isIntoManagement
(
Boolean
.
TRUE
).
dataSource
(
paramsDto
.
getDataSource
()).
equCode
(
paramsDto
.
getEquCode
()).
isFirstMerge
(
Boolean
.
FALSE
).
build
();
contraption
.
setSequenceNbr
(
seq
);
contraption
.
setCreateDate
(
new
Date
());
paramsDto
.
setProjectContraptionSeq
(
String
.
valueOf
(
seq
));
idxBizJgProjectContraptionService
.
save
(
contraption
);
return
contraption
;
...
...
@@ -2388,20 +2417,23 @@ public class DataDockServiceImpl {
String
product
=
RequestContext
.
getProduct
();
String
token
=
RequestContext
.
getToken
();
String
exeUserId
=
RequestContext
.
getExeUserId
();
Set
<
String
>
recordSet
=
new
HashSet
<>();
CompletableFuture
.
allOf
(
equLists
.
parallelStream
().
map
(
equ
->
CompletableFuture
.
runAsync
(()
->
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setExeUserId
(
exeUserId
);
saveElevatorDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
String
record
=
saveElevatorDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
recordSet
.
add
(
record
);
})).
toArray
(
CompletableFuture
[]::
new
)
).
join
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
Boolean
.
TRUE
;
}
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveElevatorDataInTransaction
(
Map
<
String
,
Object
>
equ
,
String
dataSource
,
String
remark
)
{
public
String
saveElevatorDataInTransaction
(
Map
<
String
,
Object
>
equ
,
String
dataSource
,
String
remark
)
{
String
record
=
Optional
.
ofNullable
(
equ
.
get
(
"record"
)).
map
(
String:
:
valueOf
).
orElse
(
UUID
.
randomUUID
().
toString
());
String
equList
=
Optional
.
ofNullable
(
equ
.
get
(
"equList"
)).
map
(
String:
:
valueOf
).
orElse
(
""
);
String
businessId
=
Optional
.
ofNullable
(
equ
.
get
(
"businessId"
)).
map
(
String:
:
valueOf
).
orElse
(
""
);
...
...
@@ -2434,6 +2466,7 @@ public class DataDockServiceImpl {
.
orElseGet
(()
->
equ
.
get
(
"supervisionDepartmentCode"
));
this
.
updateOrgBranchInfo
(
record
,
orgBranchName
,
orgBranchCode
);
}
return
record
;
}
catch
(
Exception
e
)
{
// esEquipmentCategory.deleteById(record);
// superviseInfoMapper.deleteDataAll(Collections.singletonList(record));
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
View file @
8f9aa4dc
...
...
@@ -24,12 +24,16 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.handler.strategy.ProblemHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ProjectWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
...
...
@@ -93,7 +97,8 @@ public class DataHandlerServiceImpl {
private
final
DataHandlerMapper
dataHandlerMapper
;
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
private
final
CommonMapper
commonMapper
;
private
final
ProblemHandleStrategy
equipmentStrategy
;;
private
final
ProblemHandleStrategy
equipmentStrategy
;
;
private
final
SafetyProblemTracingServiceImpl
safetyProblemTracingService
;
private
final
JgChangeRegistrationUnitServiceImpl
jgChangeRegistrationUnitService
;
private
final
JgChangeRegistrationUnitEqServiceImpl
jgChangeRegistrationUnitEqService
;
...
...
@@ -103,8 +108,9 @@ public class DataHandlerServiceImpl {
private
final
JgChangeRegistrationTransferMapper
jgChangeRegistrationTransferMapper
;
private
final
JgUseRegistrationManageServiceImpl
jgUseRegistrationManageServiceImpl
;
// 组织机构跟节点
private
static
final
String
ROOT_ORG_CODE
=
"50"
;
private
static
final
String
ROOT_ORG_CODE
=
"50"
;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...
...
@@ -645,13 +651,13 @@ public class DataHandlerServiceImpl {
projectContraptionService
.
saveBatch
(
projectContraptionList
);
}
// 更新设备es的装置id、使用信息的装置id
projectContraptionIdRecordsMap
.
forEach
((
k
,
v
)->
{
projectContraptionIdRecordsMap
.
forEach
((
k
,
v
)
->
{
IdxBizJgProjectContraption
idxBizJgProjectContraption
=
projectContraptionService
.
getById
(
k
);
Iterable
<
ESEquipmentCategoryDto
>
equipmentCategories
=
esEquipmentCategory
.
findAllById
(
v
);
equipmentCategories
.
forEach
(
e
->
e
.
setProjectContraptionId
(
k
+
""
));
equipmentCategories
.
forEach
(
e
->
e
.
setProjectContraptionId
(
k
+
""
));
esEquipmentCategory
.
saveAll
(
equipmentCategories
);
Collection
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
getUseInfoListByEquIds
(
v
);
useInfos
.
forEach
(
u
->
{
useInfos
.
forEach
(
u
->
{
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
u
.
getRecord
());
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
k
);
...
...
@@ -846,7 +852,7 @@ public class DataHandlerServiceImpl {
eqs
.
forEach
(
eq
->
{
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getEquId
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
if
(
StringUtils
.
isNotEmpty
(
equInfoEs
.
getProjectContraptionId
()))
{
if
(
StringUtils
.
isNotEmpty
(
equInfoEs
.
getProjectContraptionId
()))
{
IdxBizJgProjectContraption
idxBizJgProjectContraption
=
projectContraptionService
.
getById
(
equInfoEs
.
getProjectContraptionId
());
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
equInfoEs
.
getSEQUENCE_NBR
());
...
...
@@ -1050,9 +1056,9 @@ public class DataHandlerServiceImpl {
log
.
info
(
"1.西安导入数据需补充使用单位代码的设备数量:{}"
,
useInfos
.
size
());
Map
<
String
,
String
>
companynameCodeMap
=
getCompanyNameCodeMap
();
AtomicInteger
i
=
new
AtomicInteger
();
useInfos
.
forEach
(
e
->
{
useInfos
.
forEach
(
e
->
{
String
companyCode
=
companynameCodeMap
.
get
(
e
.
getUseUnitName
());
if
(
companyCode
!=
null
)
{
if
(
companyCode
!=
null
)
{
i
.
getAndIncrement
();
// 1.数据库更新
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
...
...
@@ -1075,7 +1081,7 @@ public class DataHandlerServiceImpl {
private
Map
<
String
,
String
>
getCompanyNameCodeMap
()
{
List
<
KeyValueDto
>
companyList
=
commonMapper
.
queryAllCompanyDict
();
return
companyList
.
stream
().
collect
(
Collectors
.
toMap
(
KeyValueDto:
:
getStrKey
,
KeyValueDto:
:
getStrValue
,
(
k1
,
k2
)
->
k1
));
return
companyList
.
stream
().
collect
(
Collectors
.
toMap
(
KeyValueDto:
:
getStrKey
,
KeyValueDto:
:
getStrValue
,
(
k1
,
k2
)
->
k1
));
}
public
void
restore
()
{
...
...
@@ -1087,28 +1093,28 @@ public class DataHandlerServiceImpl {
String
useUnitName
=
null
;
String
useUnitCreditCode
=
null
;
Date
date
=
null
;
if
(
"已完成"
.
equals
(
status
))
{
if
(
"已完成"
.
equals
(
status
))
{
useUnitName
=
changeRegistrationUnit
.
getNewUseUnitName
();
useUnitCreditCode
=
changeRegistrationUnit
.
getNewUseUnitCreditCode
();
date
=
changeRegistrationUnit
.
getRecDate
();
}
else
{
}
else
{
useUnitName
=
changeRegistrationUnit
.
getUseUnitName
();
useUnitCreditCode
=
changeRegistrationUnit
.
getUseUnitCreditCode
();
date
=
changeRegistrationUnit
.
getCreateDate
();
}
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
unitEqWrapper
=
new
LambdaQueryWrapper
<>();
unitEqWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
changeRegistrationUnit
.
getSequenceNbr
());
unitEqWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
changeRegistrationUnit
.
getSequenceNbr
());
List
<
JgChangeRegistrationUnitEq
>
changeRegistrationUnitEqs
=
jgChangeRegistrationUnitEqService
.
list
(
unitEqWrapper
);
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
for
(
JgChangeRegistrationUnitEq
changeRegistrationUnitEq
:
changeRegistrationUnitEqs
)
{
String
equipId
=
changeRegistrationUnitEq
.
getEquId
();
if
(
StringUtils
.
isNotEmpty
(
equipId
))
{
if
(
StringUtils
.
isNotEmpty
(
equipId
))
{
LambdaUpdateWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaUpdateWrapper
<>();
queryWrapper2
.
set
(
UseInfo:
:
getUseUnitName
,
useUnitName
);
queryWrapper2
.
set
(
UseInfo:
:
getUseUnitCreditCode
,
useUnitCreditCode
);
queryWrapper2
.
set
(
UseInfo:
:
getRecDate
,
date
);
queryWrapper2
.
set
(
UseInfo:
:
getUseUnitName
,
useUnitName
);
queryWrapper2
.
set
(
UseInfo:
:
getUseUnitCreditCode
,
useUnitCreditCode
);
queryWrapper2
.
set
(
UseInfo:
:
getRecDate
,
date
);
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
useInfoMapper
.
update
(
null
,
queryWrapper2
);
useInfoMapper
.
update
(
null
,
queryWrapper2
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
useUnitCreditCode
);
map1
.
put
(
"USE_UNIT_NAME"
,
useUnitName
);
...
...
@@ -1128,25 +1134,26 @@ public class DataHandlerServiceImpl {
* 4.移装变更登记--tzs_jg_change_registration_transfer->tzs_jg_registration_history.change_data->>orgBranchCode
* 5.历史有证气瓶导入--tzs_jg_use_registration->supervision_org_code
* 6.历史有证压力管道-管道导入-工业管道--tzs_jg_use_registration->supervision_org_code
*
* @return 成功数量数量
*/
public
Long
saveSupervise2UseRegManage
()
{
log
.
info
(
"存量数据刷属地监管部门到证管理表处理开始--->"
);
// 1|5|6 预处理,存量数据导入时缺少记录到tzs_jg_use_registration->supervision_org_code,先补充supervision_org_code到tzs_jg_use_registration
List
<
JgUseRegistrationDto
>
missingSupOrgCodeUses
=
useRegistrationService
.
getBaseMapper
().
selectMissingSupOrgCodeUseList
();
missingSupOrgCodeUses
.
parallelStream
().
forEach
(
u
->
{
List
<
JgUseRegistrationDto
>
missingSupOrgCodeUses
=
useRegistrationService
.
getBaseMapper
().
selectMissingSupOrgCodeUseList
();
missingSupOrgCodeUses
.
parallelStream
().
forEach
(
u
->
{
// TODO 历史存量数据里有:610422_三原县市场监督管理局,需要转换为:50*73*123_三原县市场监督管理局, null则挂到根节点省上
if
(
StringUtils
.
isNotEmpty
(
u
.
getSupervisoryCode
())
&&
u
.
getSupervisoryCode
().
split
(
"_"
).
length
>
1
)
{
if
(
StringUtils
.
isNotEmpty
(
u
.
getSupervisoryCode
())
&&
u
.
getSupervisoryCode
().
split
(
"_"
).
length
>
1
)
{
String
[]
orgCodeNameArray
=
u
.
getSupervisoryCode
().
split
(
"_"
);
String
orgCodeOrCompanyCode
=
orgCodeNameArray
[
0
];
LambdaUpdateWrapper
<
JgUseRegistration
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
if
(
orgCodeOrCompanyCode
.
contains
(
"*"
)
||
ROOT_ORG_CODE
.
equals
(
orgCodeOrCompanyCode
))
{
if
(
orgCodeOrCompanyCode
.
contains
(
"*"
)
||
ROOT_ORG_CODE
.
equals
(
orgCodeOrCompanyCode
))
{
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
orgCodeNameArray
[
0
]);
}
else
{
// 把companyCode换成orgCode
String
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
orgCodeOrCompanyCode
);
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
orgCode
==
null
?
ROOT_ORG_CODE:
orgCode
);
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
orgCode
==
null
?
ROOT_ORG_CODE
:
orgCode
);
}
updateWrapper
.
eq
(
JgUseRegistration:
:
getSequenceNbr
,
u
.
getSequenceNbr
());
useRegistrationService
.
update
(
updateWrapper
);
...
...
@@ -1161,38 +1168,38 @@ public class DataHandlerServiceImpl {
// 1|5|6 处理
AtomicReference
<
Long
>
dealNum
=
new
AtomicReference
<>(
0L
);
List
<
JgUseRegistrationDto
>
useRegistrations
=
useRegistrationService
.
getBaseMapper
().
getListOfPass
();
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
LambdaUpdateWrapper
<
JgUseRegistrationManage
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistrationCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getSupervisionOrgCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getSupervisionOrgName
());
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistrationCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getSupervisionOrgCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getSupervisionOrgName
());
dealNum
.
getAndSet
(
dealNum
.
get
()
+
1
);
jgUseRegistrationManageServiceImpl
.
update
(
updateWrapper
);
});
// 2 处理
List
<
JgVehicleInformation
>
vehicleUseRegs
=
jgVehicleInformationService
.
getBaseMapper
().
getListOfPass
();
vehicleUseRegs
.
parallelStream
().
forEach
(
u
->
{
vehicleUseRegs
.
parallelStream
().
forEach
(
u
->
{
LambdaUpdateWrapper
<
JgUseRegistrationManage
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistrationCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getOrgBranchCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getOrgBranchName
());
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistrationCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getOrgBranchCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getOrgBranchName
());
dealNum
.
getAndSet
(
dealNum
.
get
()
+
1
);
jgUseRegistrationManageServiceImpl
.
update
(
updateWrapper
);
});
// 3 处理
List
<
JgChangeVehicleRegistrationUnit
>
vehicleRegistrationUnits
=
jgChangeVehicleRegistrationUnitMapper
.
getListOfPass
();
vehicleRegistrationUnits
.
parallelStream
().
forEach
(
u
->
{
vehicleRegistrationUnits
.
parallelStream
().
forEach
(
u
->
{
LambdaUpdateWrapper
<
JgUseRegistrationManage
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getOrgBranchCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getOrgBranchName
());
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
u
.
getOrgBranchCode
());
updateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
u
.
getOrgBranchName
());
dealNum
.
getAndSet
(
dealNum
.
get
()
+
1
);
jgUseRegistrationManageServiceImpl
.
update
(
updateWrapper
);
});
// 4 处理
List
<
JgChangeRegistrationTransfer
>
transfers
=
jgChangeRegistrationTransferMapper
.
getListOfPass
();
transfers
.
parallelStream
().
forEach
(
u
->
{
if
(
StringUtils
.
isNotEmpty
(
u
.
getRemark
())
&&
u
.
getRemark
().
split
(
"_"
).
length
>
1
)
{
List
<
JgChangeRegistrationTransfer
>
transfers
=
jgChangeRegistrationTransferMapper
.
getListOfPass
();
transfers
.
parallelStream
().
forEach
(
u
->
{
if
(
StringUtils
.
isNotEmpty
(
u
.
getRemark
())
&&
u
.
getRemark
().
split
(
"_"
).
length
>
1
)
{
String
[]
orgCodeNameArray
=
u
.
getRemark
().
split
(
"_"
);
LambdaUpdateWrapper
<
JgUseRegistrationManage
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
u
.
getUseRegistrationCode
());
...
...
@@ -1208,6 +1215,7 @@ public class DataHandlerServiceImpl {
/**
* 历史安全追溯问题闭环【维保备案】【检验超期】--问题源都是设备
*
* @return 闭环问题数
*/
public
String
safeTraceabilityClosedLoop
()
{
...
...
@@ -1258,13 +1266,125 @@ public class DataHandlerServiceImpl {
public
String
writeEstateUnitInfoInUseInfo
()
{
List
<
Map
<
String
,
Object
>>
vehicleUseRegs
=
jgVehicleInformationService
.
getBaseMapper
().
getVehicleInfoOfPassWithEquId
();
vehicleUseRegs
.
parallelStream
().
forEach
(
u
->
{
vehicleUseRegs
.
parallelStream
().
forEach
(
u
->
{
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
u
.
get
(
"equId"
));
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getEstateUnitName
,
u
.
get
(
"estateUnitName"
));
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getEstateUnitCreditCode
,
u
.
get
(
"estateUnitCreditCode"
));
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
u
.
get
(
"equId"
));
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getEstateUnitName
,
u
.
get
(
"estateUnitName"
));
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getEstateUnitCreditCode
,
u
.
get
(
"estateUnitCreditCode"
));
useInfoService
.
update
(
updateWrapper
);
});
return
String
.
format
(
"修正车用气瓶登记未更新产权信息数据:%s条。"
,
vehicleUseRegs
.
size
());
}
public
String
initDataQualityScore
()
{
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
long
dealEquipNum
=
0L
;
Integer
maxVersion
=
useInfoService
.
getBaseMapper
().
selectMaxVersion
();
// 1.非管道数据刷数据质量等级
List
<
RefreshDataDto
>
refreshRecords
=
useInfoService
.
getBaseMapper
().
selectUseInfoOfOneVersion
(
maxVersion
);
while
(!
refreshRecords
.
isEmpty
())
{
dealEquipNum
=
refreshRecords
.
size
()
+
dealEquipNum
;
List
<
EquipWaitRefreshDataQualityScore
>
refreshDataQualityScores
=
new
ArrayList
<>();
refreshRecords
.
forEach
(
equip
->
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equip
.
getEquCategory
()))
{
// 气瓶更新逻辑
// 1.已纳管且有使用登记证的刷为:1----3级
if
(
equip
.
getIsIntoManagement
()
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
1
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 2.已纳管且无使用登记证的刷为:3----1级
if
(
equip
.
getIsIntoManagement
()
&&
StringUtils
.
isEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
3
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 3.未纳管且有使用登记证为空
String
whetherVehicleCylinder
=
StringUtils
.
isEmpty
(
equip
.
getWhetherVehicleCylinder
())
?
"0"
:
equip
.
getWhetherVehicleCylinder
();
// 3.1非车用气瓶逻辑 1
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
())
&&
"0"
.
equals
(
whetherVehicleCylinder
))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
1
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 3.2车用气瓶逻辑, 单位内部编号、出场编号全有时刷为1;缺少任意一项时刷为2
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
())
&&
"1"
.
equals
(
whetherVehicleCylinder
))
{
if
(
StringUtils
.
isEmpty
(
equip
.
getUseInnerCode
())
||
StringUtils
.
isEmpty
(
equip
.
getFactoryNum
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
2
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
if
(
StringUtils
.
isNotEmpty
(
equip
.
getUseInnerCode
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getFactoryNum
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
1
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
}
// 4.未纳管且无使用登记证的刷为:3-1级
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
3
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
}
else
{
// 非气瓶外逻辑
// 1.已纳管且有使用登记证的刷为:1----3级
if
(
equip
.
getIsIntoManagement
()
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
1
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 2.已纳管且无使用登记证的刷为:3----1级
if
(
equip
.
getIsIntoManagement
()
&&
StringUtils
.
isEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
3
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 3.未纳管且有使用登记证的刷为:1或者2,单位内部编号、出场编号全有时刷为1;缺少任意一项时刷为2
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
())
&&
(
StringUtils
.
isEmpty
(
equip
.
getUseInnerCode
())
||
StringUtils
.
isEmpty
(
equip
.
getFactoryNum
())))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
2
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseOrgCode
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getUseInnerCode
())
&&
StringUtils
.
isNotEmpty
(
equip
.
getFactoryNum
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
1
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
// 4.未纳管且无使用登记证的刷为:3-1级
if
((!
equip
.
getIsIntoManagement
())
&&
StringUtils
.
isEmpty
(
equip
.
getUseOrgCode
()))
{
EquipWaitRefreshDataQualityScore
waitRefreshDataQualityScore
=
new
EquipWaitRefreshDataQualityScore
(
equip
.
getRecord
(),
3
);
refreshDataQualityScores
.
add
(
waitRefreshDataQualityScore
);
}
}
});
// es 更新
refreshDataQualityScores
.
parallelStream
().
forEach
(
d
->
{
this
.
updateEsDataQualityScore
(
d
.
getRecord
(),
d
.
getDataQualityScore
());
});
// 数据库更新
if
(!
refreshDataQualityScores
.
isEmpty
()){
useInfoService
.
getBaseMapper
().
updateDataQualityScoreBatch
(
refreshDataQualityScores
,
maxVersion
+
1
);
}
refreshRecords
=
useInfoService
.
getBaseMapper
().
selectUseInfoOfOneVersion
(
maxVersion
);
}
// 2.管道逻辑
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
projectContraptionService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
IdxBizJgProjectContraption
>().
isNull
(
IdxBizJgProjectContraption:
:
getProjectContraptionParentId
).
select
(
BaseEntity:
:
getSequenceNbr
,
IdxBizJgProjectContraption:
:
getUseRegistrationCode
));
List
<
ProjectWaitRefreshDataQualityScore
>
projectWaitRefreshDataQualityScores
=
projectContraptionList
.
stream
().
map
(
p
->{
ProjectWaitRefreshDataQualityScore
projectWaitRefreshDataQualityScore
=
new
ProjectWaitRefreshDataQualityScore
();
projectWaitRefreshDataQualityScore
.
setProjectContraptionId
(
p
.
getSequenceNbr
());
if
(
StringUtils
.
isNotEmpty
(
p
.
getUseRegistrationCode
())){
projectWaitRefreshDataQualityScore
.
setDataQualityScore
(
1
);
}
else
{
projectWaitRefreshDataQualityScore
.
setDataQualityScore
(
3
);
}
return
projectWaitRefreshDataQualityScore
;
}).
collect
(
Collectors
.
toList
());
if
(!
projectWaitRefreshDataQualityScores
.
isEmpty
()){
projectContraptionService
.
getBaseMapper
().
updateDataQualityScoreBatch
(
projectWaitRefreshDataQualityScores
);
}
watch
.
stop
();
log
.
info
(
"耗时秒:{}"
,
watch
.
getTotalTimeSeconds
());
return
"success"
;
}
private
void
updateEsDataQualityScore
(
String
record
,
Integer
dataQualityScore
)
{
// 1.es更新
Optional
<
ESEquipmentCategoryDto
>
categoryDto
=
esEquipmentCategory
.
findById
(
record
);
categoryDto
.
ifPresent
(
categoryEs
->
{
categoryEs
.
setDataQualityScore
(
dataQualityScore
);
esEquipmentCategory
.
save
(
categoryEs
);
});
}
}
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 @
8f9aa4dc
...
...
@@ -164,6 +164,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 新增修改标识
private
static
final
String
OPERATESAVE
=
"save"
;
private
static
final
String
OPERATEEDIT
=
"edit"
;
private
static
final
String
ADD
=
"add"
;
private
static
final
String
EDIT
=
"edit"
;
//市区县
private
static
final
String
CITY
=
"CITY"
;
private
static
final
String
COUNTY
=
"COUNTY"
;
...
...
@@ -550,6 +554,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
projectContraption
.
setUscUnitCreditCode
(
companyInfoMap
.
get
(
"creditCode"
).
toString
());
}
projectContraption
.
setIsFirstMerge
(
false
);
if
(
"add"
.
equals
(
submitType
))
{
projectContraption
.
setCreateDate
(
date
);
}
idxBizJgProjectContraptionService
.
saveOrUpdateData
(
projectContraption
);
List
<
IdxBizJgUseInfo
>
useInfoList
=
initializeList
();
...
...
@@ -604,6 +611,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfo
.
setRecord
(
record
);
useInfo
.
setSequenceNbr
(
null
);
useInfo
.
setRecDate
(
date
);
useInfo
.
setCreateDate
(
date
);
useInfo
.
setDataSource
(
dataSource
);
useInfo
.
setIsIntoManagement
(
Boolean
.
FALSE
);
if
(
companyTypeStr
.
contains
(
CompanyTypeEnum
.
USE
.
getCode
())
||
companyTypeStr
.
contains
(
CompanyTypeEnum
.
INDIVIDUAL
.
getCode
()))
{
...
...
@@ -1106,9 +1114,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 设备注册信息
Map
<
String
,
Object
>
equipInfoMap
=
this
.
getEquipInfoMap
(
record
,
""
);
if
(!
ValidationUtil
.
isEmpty
(
equIpClassMap
))
{
equIpClassMap
.
put
(
DATA_SOURCE
,
equipInfoMap
.
get
(
DATA_SOURCE
));
resultMap
.
put
(
EQUIP_CLASS_FORM_ID
,
equIpClassMap
);
}
equipInfoMap
.
put
(
"companyLevel"
,
companyLevel
);
equipInfoMap
.
put
(
"type"
,
equIpClassMap
.
get
(
"type"
));
// 设备参数
if
(
equIpClassMap
.
containsKey
(
EQU_LIST
)
&&
!
ValidationUtil
.
isEmpty
(
equIpClassMap
.
get
(
EQU_LIST
).
toString
()))
{
Map
<
String
,
Object
>
equipParamsMap
=
this
.
getEquipParamsMap
(
record
,
""
,
equIpClassMap
.
get
(
EQU_LIST
).
toString
());
...
...
@@ -1469,6 +1479,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
objMap
.
put
(
DATA_SOURCE_NAME
,
EquipSourceEnum
.
getDataSourceName
(
useInfo
.
getDataSource
()));
objMap
.
put
(
DATA_SOURCE
,
EquipSourceEnum
.
getDataSourceType
(
useInfo
.
getDataSource
()));
// 设计制造
IdxBizJgDesignInfo
designInfo
=
iIdxBizJgDesignInfoService
.
getOneData
(
record
);
if
(!
ValidationUtil
.
isEmpty
(
designInfo
))
{
...
...
@@ -3299,7 +3310,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 其他信息
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgOtherInfo
.
class
);
// 检验检测 【新增时】 固定式压力容器(2100)和 气瓶(2300)可以添加检验检测信息
if
(
"add"
.
equals
(
submitType
)
||
isCopy
)
{
if
(
ADD
.
equals
(
submitType
)
||
isCopy
)
{
// 历史无证设备创建且是检验信息齐全时才创建检验信息
if
(
dataSource
.
contains
(
"jg_his_black"
)
&&
InspectIsInPeriodEnum
.
IN_PERIOD_YES
.
getValue
().
equals
(
registerInfo
.
getInInspectionPeriod
()))
{
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgInspectionDetectionInfo
.
class
);
...
...
@@ -3363,6 +3374,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfo
.
setUseUnitCreditCode
(
companyInfoMap
.
get
(
"creditCode"
).
toString
());
useInfo
.
setUseUnitName
(
companyInfoMap
.
get
(
"companyName"
).
toString
());
}
if
(
OPERATESAVE
.
equals
(
operateType
))
{
useInfo
.
setCreateDate
(
date
);
}
if
(
isCopy
)
{
// 设备状态置空
...
...
@@ -3629,11 +3643,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
String
getDataSource
(
String
operateType
,
LinkedHashMap
equipmentInfoForm
)
{
// 数据来源 历史数据his 新数据new
String
equipSource
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
DATA_SOURCE
));
if
(
OPERATESAVE
.
equals
(
operateType
)){
return
"new"
.
equals
(
equipSource
)
?
"jg"
:
"his"
.
equals
(
equipSource
)
?
"jg_his"
:
"jg_his_black"
;
}
else
{
return
equipSource
;
}
return
"new"
.
equals
(
equipSource
)
?
"jg"
:
"his"
.
equals
(
equipSource
)
?
"jg_his"
:
"jg_his_black"
;
}
public
void
checkEsData
(
String
id
)
{
...
...
@@ -3880,6 +3890,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
orgBranchName
=
""
;
orgBranchCode
=
""
;
}
Set
<
String
>
recordSet
=
new
HashSet
<>();
equipInfoCylinderExcelDtoList
.
forEach
(
data
->
{
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
())
&&
"1"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
...
...
@@ -3894,6 +3905,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
this
.
checkUseRegistrationCode
(
equipInfoDto
.
getUseOrgCode
(),
"cylinder"
);
}
String
record
=
UUID
.
randomUUID
().
toString
();
recordSet
.
add
(
record
);
jgRelationEquip
.
setEquId
(
record
);
jgRelationEquip
.
setSequenceNbr
(
sequence
.
nextId
());
jgRelationEquipList
.
add
(
jgRelationEquip
);
...
...
@@ -3914,6 +3926,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BeanUtils
.
copyProperties
(
data
,
useInfo
);
useInfo
.
setRecord
(
record
);
useInfo
.
setRecDate
(
new
Date
());
useInfo
.
setCreateDate
(
new
Date
());
useInfo
.
setDataSource
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
())
?
"jg_his"
:
"jg"
);
// 区分历史设备和新增设备
useInfo
.
setEquState
(
null
);
useInfo
.
setIsIntoManagement
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()));
// 历史气瓶导入为已纳管设备
...
...
@@ -4187,6 +4200,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Optional
.
of
(
paramsVesselList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgTechParamsVesselService:
:
saveBatch
);
Optional
.
of
(
inspectionDetectionInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgInspectionDetectionInfoService:
:
saveBatch
);
Optional
.
of
(
esEquipmentCategoryList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
esEquipmentCategory:
:
saveAll
);
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
String
.
format
(
"导入完成,成功导入: %d 条数据!"
,
useInfoList
.
size
());
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
8f9aa4dc
...
...
@@ -1930,7 +1930,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新es的下次检验日期
param
.
put
(
"NEXT_INSPECT_DATE"
,
this
.
castDate2TimeStr
(
dataMap
.
getString
(
"nextInspectDate"
)));
param
.
put
(
"USE_INNER_CODE"
,
useInfo
.
getUseInnerCode
());
param
.
put
(
"IS_INTO_MANAGEMENT"
,
true
);
if
(!
Arrays
.
asList
(
"temp"
,
"tempEdit"
).
contains
(
dataMap
.
get
(
"historySubmitType"
)))
{
param
.
put
(
"IS_INTO_MANAGEMENT"
,
true
);
}
param
.
put
(
"USE_PLACE_CODE"
,
jsonObject
.
get
(
"province"
)
+
"#"
+
jsonObject
.
get
(
"city"
)
+
"#"
+
jsonObject
.
get
(
"county"
)
+
"#"
+
jsonObject
.
get
(
"factoryUseSiteStreet"
));
param
.
put
(
"USE_SITE_CODE"
,
String
.
valueOf
(
jsonObject
.
get
(
"usePlace"
)));
param
.
put
(
"ORG_BRANCH_CODE"
,
branchCode
);
...
...
@@ -3971,6 +3973,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
handleHistoryEquip
(
JSONObject
map
)
{
try
{
Object
submitType
=
map
.
get
(
"historySubmitType"
);
// 使用登记证编号
String
useRegistrationCode
=
Optional
.
ofNullable
(
Objects
.
toString
(
map
.
get
(
"useOrgCode"
),
null
))
.
map
(
String:
:
trim
)
...
...
@@ -4108,36 +4111,52 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgUseRegistration
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setEquId
(
map
.
get
(
"equipId"
).
toString
()
);
jgUseRegistrationEq
.
setEquId
(
equipId
);
jgRelationEquipMapper
.
update
(
jgUseRegistrationEq
,
lambda
);
}
else
{
// 业务管理设备信息保存
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
jgRelationEquip
.
setEquId
(
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
));
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
//新增暂存
if
(!
Arrays
.
asList
(
"tempSubmit"
,
"tempEdit"
).
contains
(
submitType
)){
// 业务管理设备信息保存
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
jgRelationEquip
.
setEquId
(
equipId
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
}
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
String
status
=
"temp"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
jgUseRegistration
.
setStatus
(
status
);
jgUseRegistration
.
setUseRegistrationCode
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"useOrgCode"
))
?
""
:
String
.
valueOf
(
map
.
get
(
"useOrgCode"
)));
jgUseRegistration
.
setRegType
(
"1"
);
//历史登记
this
.
save
(
jgUseRegistration
);
jgRelationEquip
.
setEquipTransferId
(
jgUseRegistration
.
getSequenceNbr
().
toString
());
jgRelationEquipMapper
.
insert
(
jgRelationEquip
);
}
else
{
String
status
=
"tempEdit"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
jgUseRegistration
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
jgUseRegistration
.
setStatus
(
status
);
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
// 更新设备关联表
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgUseRegistration
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setEquId
(
equipId
);
jgRelationEquipMapper
.
update
(
jgUseRegistrationEq
,
lambda
);
}
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
Object
submitType
=
map
.
get
(
"historySubmitType"
);
String
status
=
"temp"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
jgUseRegistration
.
setStatus
(
status
);
jgUseRegistration
.
setUseRegistrationCode
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"useOrgCode"
))
?
""
:
String
.
valueOf
(
map
.
get
(
"useOrgCode"
)));
jgUseRegistration
.
setRegType
(
"1"
);
//历史登记
this
.
save
(
jgUseRegistration
);
jgRelationEquip
.
setEquipTransferId
(
jgUseRegistration
.
getSequenceNbr
().
toString
());
jgRelationEquipMapper
.
insert
(
jgRelationEquip
);
// 暂存历史表
updateHistory
(
map
,
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
),
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()),
jgUseRegistration
.
getSupervisoryCode
());
//监督管理信息
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>
lambdaSup
=
new
QueryWrapper
<
IdxBizJgSupervisionInfo
>().
lambda
();
lambdaSup
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
()
);
lambdaSup
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
equipId
);
IdxBizJgSupervisionInfo
supervisionInfo
=
idxBizJgSupervisionInfoMapper
.
selectOne
(
lambdaSup
);
if
(
supervisionInfo
!=
null
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"orgBranchCode"
)))
{
supervisionInfo
.
setOrgBranchCode
(
String
.
valueOf
(
map
.
get
(
"orgBranchCode"
)).
split
(
"_"
)[
0
]);
...
...
@@ -4147,13 +4166,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 注册信息
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
()
);
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equipId
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
String
equCode
=
""
;
String
equCode
=
Objects
.
toString
(
map
.
get
(
"equCode"
),
null
)
;
if
(
registerInfo
!=
null
)
{
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
registerInfo
.
setEquCodeType
(
String
.
valueOf
(
map
.
get
(
"equCodeType"
)));
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
if
(
submitType
.
equals
(
"tempSubmit"
)){
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
&&
!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getReceiveCompanyCode
())
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
}
registerInfo
.
setEquCode
(
equCode
);
// 设备代码
registerInfo
.
setEquPrice
(
String
.
valueOf
(
map
.
get
(
"equPrice"
)));
registerInfo
.
setProductPhoto
(
JSONObject
.
toJSONString
(
map
.
get
(
"productPhoto"
)));
...
...
@@ -4167,7 +4190,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 设计信息
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>
lambdaDes
=
new
QueryWrapper
<
IdxBizJgDesignInfo
>().
lambda
();
lambdaDes
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
()
);
lambdaDes
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
equipId
);
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoService
.
getOne
(
lambdaDes
);
if
(
designInfo
!=
null
)
{
designInfo
.
setDesignUnitCreditCode
(
MapUtil
.
getStr
(
map
,
"designUnitCreditCode"
));
...
...
@@ -4186,7 +4209,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
()
);
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
equipId
);
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
idxBizJgFactoryInfoService
.
getOne
(
factoryInfoWrapper
);
if
(
idxBizJgFactoryInfo
!=
null
)
{
idxBizJgFactoryInfo
.
setProduceUnitCreditCode
(
MapUtil
.
getStr
(
map
,
"produceUnitCreditCode"
));
...
...
@@ -4296,21 +4319,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
// 历史设备 生成证书管理表记录 & 生成安装 维保等操作记录
if
(
registerInfo
!=
null
)
{
if
(
registerInfo
!=
null
&&
!
Arrays
.
asList
(
"temp"
,
"tempEdit"
).
contains
(
map
.
get
(
"historySubmitType"
))
)
{
this
.
historyEquGenManageRelated
(
map
,
jgUseRegistration
,
registerInfo
,
idxBizJgFactoryInfo
);
String
routePath
=
this
.
buildTaskModel
(
jgUseRegistration
,
map
,
reginParams
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
())
.
businessId
(
jgUseRegistration
.
getSequenceNbr
()
+
""
)
.
equId
(
String
.
valueOf
(
map
.
get
(
"equipId"
)))
.
approvalUnit
(
jgUseRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgUseRegistration
.
getReceiveOrgCode
())
.
status
(
"正常"
)
.
routePath
(
routePath
)
.
changeContent
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
build
());
}
String
routePath
=
this
.
buildTaskModel
(
jgUseRegistration
,
map
,
reginParams
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
())
.
businessId
(
jgUseRegistration
.
getSequenceNbr
()
+
""
)
.
equId
(
String
.
valueOf
(
map
.
get
(
"equipId"
)))
.
approvalUnit
(
jgUseRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgUseRegistration
.
getReceiveOrgCode
())
.
status
(
"正常"
)
.
routePath
(
routePath
)
.
changeContent
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
build
());
}
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/utils/MemoryPageUtils.java
0 → 100644
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
utils
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Comparator
;
import
java.util.List
;
public
class
MemoryPageUtils
{
/**
* 内存分页(支持排序)
*
* @param dataList 数据列表
* @param current 当前页(从1开始)
* @param size 每页大小
* @param comparator 排序规则(可选,传null表示不排序)
*/
public
static
<
T
>
IPage
<
T
>
paginate
(
List
<
T
>
dataList
,
long
current
,
long
size
,
Comparator
<
T
>
comparator
)
{
// 1. 参数校验
if
(
current
<
1
||
size
<=
0
)
{
throw
new
IllegalArgumentException
(
"分页参数错误:current >= 1 && size > 0"
);
}
// 2. 避免空指针
if
(
dataList
==
null
||
dataList
.
isEmpty
())
{
return
new
Page
<>(
current
,
size
,
0
);
}
// 3. 排序(如果传入了comparator)
if
(
comparator
!=
null
)
{
dataList
.
sort
(
comparator
);
}
// 4. 计算分页区间
long
total
=
dataList
.
size
();
long
fromIndex
=
(
current
-
1
)
*
size
;
if
(
fromIndex
>=
total
)
{
return
new
Page
<>(
current
,
size
,
total
);
// 超出范围返回空页
}
// 5. 手动分页
List
<
T
>
pageRecords
=
dataList
.
subList
(
(
int
)
fromIndex
,
(
int
)
Math
.
min
(
fromIndex
+
size
,
total
)
);
// 6. 构造IPage对象
IPage
<
T
>
page
=
new
Page
<>(
current
,
size
,
total
);
page
.
setRecords
(
pageRecords
);
return
page
;
}
// 简化版(不排序)
public
static
<
T
>
IPage
<
T
>
paginate
(
List
<
T
>
dataList
,
long
current
,
long
size
)
{
return
paginate
(
dataList
,
current
,
size
,
null
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/EquipWaitRefreshDataQualityScore.java
0 → 100644
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
@Data
@AllArgsConstructor
public
class
EquipWaitRefreshDataQualityScore
{
private
String
record
;
private
Integer
dataQualityScore
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/ProjectWaitRefreshDataQualityScore.java
0 → 100644
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
@Data
public
class
ProjectWaitRefreshDataQualityScore
{
private
Long
projectContraptionId
;
private
Integer
dataQualityScore
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/RefreshDataDto.java
0 → 100644
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
dto
;
import
lombok.Data
;
@Data
public
class
RefreshDataDto
{
private
String
record
;
private
Boolean
isIntoManagement
;
private
String
useInnerCode
;
private
String
factoryNum
;
private
String
useOrgCode
;
private
String
equList
;
private
String
equCategory
;
private
String
equDefine
;
private
String
whetherVehicleCylinder
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgProjectContraption.java
View file @
8f9aa4dc
...
...
@@ -3,10 +3,11 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 管道工程装置表
*
...
...
@@ -306,4 +307,9 @@ public class IdxBizJgProjectContraption extends BaseEntity {
@TableField
(
"data_quality_score"
)
private
String
dataQualityScore
;
/**
* 创建日期
*/
@TableField
(
"create_date"
)
private
Date
createDate
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
View file @
8f9aa4dc
...
...
@@ -326,4 +326,11 @@ public class IdxBizJgUseInfo extends TzsBaseEntity implements IBaseChangeData {
*/
@TableField
(
"\"DATA_QUALITY_SCORE\""
)
private
Integer
dataQualityScore
;
/**
* 刷库专用字段
*/
@TableField
(
"\"VERSION\""
)
private
String
version
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgProjectContraptionMapper.java
View file @
8f9aa4dc
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ProjectWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -110,4 +111,5 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
List
<
Map
<
String
,
Object
>>
selectPipelineList
(
@Param
(
"equIds"
)
List
<
String
>
equIds
);
void
updateDataQualityScoreBatch
(
@Param
(
"projectContraptions"
)
List
<
ProjectWaitRefreshDataQualityScore
>
projectContraptions
);
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
View file @
8f9aa4dc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
...
...
@@ -15,4 +18,10 @@ public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void
batchUpdateUseInfo
(
@Param
(
"records"
)
List
<
String
>
records
,
Integer
code
);
List
<
IdxBizJgUseInfo
>
selectXAList
();
List
<
RefreshDataDto
>
selectUseInfoOfOneVersion
(
Integer
version
);
Integer
selectMaxVersion
();
void
updateDataQualityScoreBatch
(
@Param
(
"equips"
)
List
<
EquipWaitRefreshDataQualityScore
>
refreshDataQualityScores
,
@Param
(
"version"
)
int
version
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgProjectContraptionMapper.xml
View file @
8f9aa4dc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper"
>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
SELECT
SEQUENCE_NBR,
...
...
@@ -610,4 +609,10 @@
GROUP BY a.project_contraption_id
) GROUP BY project_contraption_id
</select>
<update
id=
"updateDataQualityScoreBatch"
>
<foreach
collection=
"projectContraptions"
separator=
";"
item=
"projectContraption"
open=
""
close=
""
>
UPDATE idx_biz_jg_project_contraption SET data_quality_score = #{projectContraption.dataQualityScore} WHERE sequence_nbr = #{projectContraption.projectContraptionId}
</foreach>
</update>
</mapper>
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
View file @
8f9aa4dc
...
...
@@ -8,6 +8,11 @@
#{record}
</foreach>
</update>
<update
id=
"updateDataQualityScoreBatch"
>
<foreach
collection=
"equips"
separator=
";"
item=
"equip"
open=
""
close=
""
>
UPDATE idx_biz_jg_use_info SET "DATA_QUALITY_SCORE" = #{equip.dataQualityScore} , "VERSION"=#{version} WHERE record = #{equip.record}
</foreach>
</update>
<select
id=
"selectXAList"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo"
>
select
u."SEQUENCE_NBR",
...
...
@@ -23,4 +28,31 @@
)
and u."USE_UNIT_NAME"
<![CDATA[ <> ]]>
''
</select>
<select
id=
"selectUseInfoOfOneVersion"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto"
>
SELECT
ui.record,
ui.is_into_management,
ui.use_inner_code,
fi.factory_num,
jri.use_org_code,
jri.equ_list,
jri.EQU_CATEGORY,
jri.EQU_DEFINE,
jri.WHETHER_VEHICLE_CYLINDER
from
"idx_biz_jg_use_info" ui
LEFT JOIN idx_biz_jg_register_info jri ON jri.RECORD = ui.RECORD
LEFT JOIN idx_biz_jg_factory_info fi on fi."RECORD" = ui."RECORD"
where
jri.EQU_LIST !='8000'
AND (ui.VERSION
<![CDATA[ <> ]]>
1 or ui.VERSION is null)
and jri.EQU_CATEGORY
<![CDATA[ <> ]]>
''
and ui.is_into_management is not null
limit 10000
</select>
<select
id=
"selectMaxVersion"
resultType=
"java.lang.Integer"
>
SELECT
COALESCE(MAX(version),0) as version
FROM "idx_biz_jg_use_info"
</select>
</mapper>
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