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
cfa77872
Commit
cfa77872
authored
Oct 17, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):处理新设备管道导入问题
parent
be352b8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
20 deletions
+51
-20
DataDockController.java
...mos/boot/module/jg/biz/controller/DataDockController.java
+4
-4
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+43
-15
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+4
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataDockController.java
View file @
cfa77872
...
@@ -38,7 +38,7 @@ public class DataDockController extends BaseController {
...
@@ -38,7 +38,7 @@ public class DataDockController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/xi-an/saveEquipmentData"
)
@PostMapping
(
value
=
"/xi-an/saveEquipmentData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"西安数据对接-设备批量导入"
,
notes
=
"西安数据对接-导入多个设备的数据文件"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"西安数据对接-设备批量导入"
,
notes
=
"西安数据对接-导入多个设备的数据文件"
)
public
ResponseModel
<?>
saveEquipmentData
(
@RequestBody
List
<
Map
<
String
,
Object
>>
equLists
)
throws
Exception
{
public
ResponseModel
<?>
saveEquipmentData
(
@RequestBody
List
<
Map
<
String
,
Object
>>
equLists
)
{
return
ResponseHelper
.
buildResponse
(
dataDockService
.
xiAnSaveEquipmentData
(
equLists
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
xiAnSaveEquipmentData
(
equLists
));
}
}
...
@@ -130,14 +130,14 @@ public class DataDockController extends BaseController {
...
@@ -130,14 +130,14 @@ public class DataDockController extends BaseController {
}
}
/**
/**
*
气瓶批量保存
*
台套类设备,气瓶,新管道都使用此方法
**/
**/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveSetEquipImportData"
)
@PostMapping
(
value
=
"/saveSetEquipImportData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"台套类设备导入字段保存"
,
notes
=
"台套类设备导入字段保存"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"台套类设备导入字段保存"
,
notes
=
"台套类设备导入字段保存"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
public
ResponseModel
<?>
save
Set
EquipImportData
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
public
ResponseModel
<?>
saveEquipImportData
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
dataDockService
.
save
Set
EquipImportData
(
paramMap
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
saveEquipImportData
(
paramMap
));
}
}
/**
/**
...
...
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 @
cfa77872
...
@@ -74,6 +74,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -74,6 +74,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -303,7 +304,7 @@ public class DataDockServiceImpl {
...
@@ -303,7 +304,7 @@ public class DataDockServiceImpl {
.
list
().
stream
().
findFirst
().
orElse
(
null
);
.
list
().
stream
().
findFirst
().
orElse
(
null
);
}
}
projectContraption
.
setRecDate
(
new
Date
());
projectContraption
.
setRecDate
(
new
Date
());
projectContraption
.
setDataQualityScore
(
"
1
"
);
projectContraption
.
setDataQualityScore
(
"
3
"
);
if
(
ObjectUtils
.
isEmpty
(
oldContraption
)
)
{
// save
if
(
ObjectUtils
.
isEmpty
(
oldContraption
)
)
{
// save
sequenceNbr
=
sequence
.
nextId
();
sequenceNbr
=
sequence
.
nextId
();
projectContraption
.
setSequenceNbr
(
sequenceNbr
);
projectContraption
.
setSequenceNbr
(
sequenceNbr
);
...
@@ -323,7 +324,7 @@ public class DataDockServiceImpl {
...
@@ -323,7 +324,7 @@ public class DataDockServiceImpl {
projectContraption
.
setEquCategoryName
(
EquCategoryConverter
.
getKeyByValue
((
String
)
equ
.
get
(
"equCategory"
)));
projectContraption
.
setEquCategoryName
(
EquCategoryConverter
.
getKeyByValue
((
String
)
equ
.
get
(
"equCategory"
)));
projectContraption
.
setEquDefine
((
String
)
equ
.
get
(
"equDefine"
));
projectContraption
.
setEquDefine
((
String
)
equ
.
get
(
"equDefine"
));
projectContraption
.
setEquDefineName
(
EquDefineConverter
.
getKeyByValue
((
String
)
equ
.
get
(
"equDefine"
)));
projectContraption
.
setEquDefineName
(
EquDefineConverter
.
getKeyByValue
((
String
)
equ
.
get
(
"equDefine"
)));
projectContraption
.
setPipelineLength
(
Double
.
parseDouble
((
String
)
equ
.
get
(
"pipeLength"
)
));
projectContraption
.
setPipelineLength
(
new
BigDecimal
(
Objects
.
toString
(
equ
.
get
(
"totalPipeLength"
),
"0"
)).
doubleValue
(
));
projectContraption
.
setUseRegistrationCode
((
String
)
equ
.
get
(
"useOrgCode"
));
projectContraption
.
setUseRegistrationCode
((
String
)
equ
.
get
(
"useOrgCode"
));
projectContraption
.
setIsIntoManagement
(
Boolean
.
FALSE
);
projectContraption
.
setIsIntoManagement
(
Boolean
.
FALSE
);
projectContraption
.
setDataSource
(
dataSource
);
projectContraption
.
setDataSource
(
dataSource
);
...
@@ -1564,7 +1565,16 @@ public class DataDockServiceImpl {
...
@@ -1564,7 +1565,16 @@ public class DataDockServiceImpl {
}
}
Set
<
String
>
recordSet
=
new
HashSet
<>();
Set
<
String
>
recordSet
=
new
HashSet
<>();
Set
<
String
>
projectContraptionSet
=
new
HashSet
<>();
Set
<
String
>
projectContraptionSet
=
new
HashSet
<>();
Map
<
String
,
Long
>
projectContraptionMap
=
new
HashMap
<>();
// 循环外声明
Map
<
String
,
Long
>
projectContraptionMap
=
new
HashMap
<>();
Map
<
String
,
BigDecimal
>
pipeLengthMap
=
equipInfoExcelDtos
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
e
->
Objects
.
toString
(
e
.
getProjectContraptionNo
(),
""
).
trim
(),
Collectors
.
mapping
(
e
->
new
BigDecimal
(
Objects
.
toString
(
e
.
getPipeLength
(),
"0"
)),
Collectors
.
reducing
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
)
));
Set
<
String
>
projectContraptionIdSet
=
new
HashSet
<>();
for
(
EquipInfoExcelDto
equ
:
equipInfoExcelDtos
)
{
for
(
EquipInfoExcelDto
equ
:
equipInfoExcelDtos
)
{
List
<
Map
<
String
,
Object
>>
fileDataList
=
(
List
<
Map
<
String
,
Object
>>)
equ
.
getFileData
();
List
<
Map
<
String
,
Object
>>
fileDataList
=
(
List
<
Map
<
String
,
Object
>>)
equ
.
getFileData
();
Map
<
String
,
Object
>
equMap
=
(
Map
<
String
,
Object
>)
JSON
.
parseObject
(
toJSONString
(
equ
),
Map
.
class
);
Map
<
String
,
Object
>
equMap
=
(
Map
<
String
,
Object
>)
JSON
.
parseObject
(
toJSONString
(
equ
),
Map
.
class
);
...
@@ -1579,26 +1589,30 @@ public class DataDockServiceImpl {
...
@@ -1579,26 +1589,30 @@ public class DataDockServiceImpl {
String
projectContraptionNo
=
Objects
.
toString
(
equMap
.
get
(
"projectContraptionNo"
),
""
).
trim
();
String
projectContraptionNo
=
Objects
.
toString
(
equMap
.
get
(
"projectContraptionNo"
),
""
).
trim
();
Long
projectContraptionId
;
Long
projectContraptionId
;
if
(!
projectContraptionSet
.
contains
(
projectContraptionNo
))
{
if
(!
projectContraptionSet
.
contains
(
projectContraptionNo
))
{
projectContraptionId
=
saveProjectContraption
(
equMap
,
equList
,
company
,
dataSource
);
BigDecimal
totalPipeLength
=
pipeLengthMap
.
getOrDefault
(
projectContraptionNo
,
BigDecimal
.
ZERO
);
equMap
.
put
(
"totalPipeLength"
,
totalPipeLength
);
projectContraptionId
=
this
.
saveProjectContraption
(
equMap
,
equList
,
company
,
dataSource
);
projectContraptionSet
.
add
(
projectContraptionNo
);
projectContraptionSet
.
add
(
projectContraptionNo
);
projectContraptionMap
.
put
(
projectContraptionNo
,
projectContraptionId
);
projectContraptionMap
.
put
(
projectContraptionNo
,
projectContraptionId
);
}
else
{
}
else
{
projectContraptionId
=
projectContraptionMap
.
get
(
projectContraptionNo
);
projectContraptionId
=
projectContraptionMap
.
get
(
projectContraptionNo
);
}
}
equMap
.
put
(
"projectContraptionId"
,
projectContraptionId
);
if
(
projectContraptionId
!=
null
)
{
String
record
=
saveEquipmentDataInTransaction
(
equMap
,
dataSource
,
remark
);
projectContraptionIdSet
.
add
(
String
.
valueOf
(
projectContraptionId
));
equMap
.
put
(
"projectContraptionId"
,
projectContraptionId
);
}
String
record
=
this
.
saveEquipmentDataInTransaction
(
equMap
,
dataSource
,
remark
);
recordSet
.
add
(
record
);
recordSet
.
add
(
record
);
}
}
this
.
createResumeBatch
(
recordSet
,
dataSource
,
equipRoutePath
,
company
);
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equList
))
{
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
.
createResumePipelineBatch
(
projectContraptionIdSet
,
String
.
format
(
pipelineRoutePath
,
projectContraptionIdSet
),
company
);
this
,
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
projectContraptionIdSet
,
EquipCreateOrEditEvent
.
EquipType
.
project
));
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
}
else
{
recordSet
,
this
.
createResumeBatch
(
recordSet
,
dataSource
,
equipRoutePath
,
company
);
EquipCreateOrEditEvent
.
EquipType
.
equip
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
));
}
}
}
private
void
createResumeBatch
(
Set
<
String
>
records
,
String
dataSource
,
String
routePath
,
CompanyBo
company
)
{
private
void
createResumeBatch
(
Set
<
String
>
records
,
String
dataSource
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
records
.
stream
().
map
(
record
->
JgResumeInfoDto
.
builder
()
jgResumeInfoService
.
saveBatchResume
(
records
.
stream
().
map
(
record
->
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
())
.
businessType
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
())
...
@@ -1613,6 +1627,20 @@ public class DataDockServiceImpl {
...
@@ -1613,6 +1627,20 @@ public class DataDockServiceImpl {
);
);
}
}
private
void
createResumePipelineBatch
(
Set
<
String
>
projectContraptionIdSet
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
projectContraptionIdSet
.
stream
().
map
(
projectContraptionId
->
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
())
.
businessId
(
projectContraptionId
)
.
equId
(
projectContraptionId
)
.
status
(
"正常"
)
.
approvalUnitCode
(
company
.
getCompanyCode
())
.
approvalUnit
(
company
.
getCompanyName
())
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
/**
/**
* 批量异步保存设备数据
* 批量异步保存设备数据
*
*
...
@@ -1770,7 +1798,7 @@ public class DataDockServiceImpl {
...
@@ -1770,7 +1798,7 @@ public class DataDockServiceImpl {
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Object
save
Set
EquipImportData
(
Map
<
String
,
Object
>
paramMap
)
{
public
Object
saveEquipImportData
(
Map
<
String
,
Object
>
paramMap
)
{
if
(
paramMap
==
null
)
{
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
cfa77872
...
@@ -3959,7 +3959,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3959,7 +3959,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
String
getDataSource
(
String
operateType
,
LinkedHashMap
equipmentInfoForm
)
{
private
String
getDataSource
(
String
operateType
,
LinkedHashMap
equipmentInfoForm
)
{
// 数据来源 历史数据his 新数据new
// 数据来源 历史数据his 新数据new
String
equipSource
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
DATA_SOURCE
));
String
equipSource
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
DATA_SOURCE
));
return
"new"
.
equals
(
equipSource
)
?
"jg"
:
"his"
.
equals
(
equipSource
)
?
"jg_his"
:
"jg_his_black"
;
return
"new"
.
equals
(
equipSource
)
?
"jg"
:
"his"
.
equals
(
equipSource
)
?
"jg_his"
:
"jg_pl"
.
equals
(
equipSource
)
?
"jg_pl"
:
"jg_his_black"
;
}
}
public
void
checkEsData
(
String
id
)
{
public
void
checkEsData
(
String
id
)
{
...
...
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