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
0deb2b65
Commit
0deb2b65
authored
Apr 18, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):西安电梯历史数据导入接口修改
parent
eb626831
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
16 deletions
+129
-16
DictParamsConverter.java
...ejoin/amos/api/openapi/converter/DictParamsConverter.java
+0
-11
EquStateConverter.java
...yeejoin/amos/api/openapi/converter/EquStateConverter.java
+47
-0
UsePlaceConverter.java
...yeejoin/amos/api/openapi/converter/UsePlaceConverter.java
+66
-0
XiAnElevatorExcelDto.java
...om/yeejoin/amos/api/openapi/dto/XiAnElevatorExcelDto.java
+6
-1
XiAnDataDockServiceImpl.java
...oin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
+0
-0
ESEquipmentCategoryDto.java
...os/boot/module/common/api/dto/ESEquipmentCategoryDto.java
+1
-1
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+9
-3
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/converter/DictParamsConverter.java
View file @
0deb2b65
...
...
@@ -81,17 +81,6 @@ public class DictParamsConverter implements Converter<String> {
dictMap
.
put
(
"其他控制方式"
,
"4"
);
dictMap
.
put
(
"直接顶升"
,
"1"
);
dictMap
.
put
(
"间接顶升"
,
"2"
);
dictMap
.
put
(
"游乐场所"
,
"6532"
);
dictMap
.
put
(
"商业单位"
,
"6009"
);
dictMap
.
put
(
"学校"
,
"6010"
);
dictMap
.
put
(
"政府机关"
,
"6012"
);
dictMap
.
put
(
"医疗机构"
,
"6011"
);
dictMap
.
put
(
"公共场所"
,
"6013"
);
dictMap
.
put
(
"旅游景区"
,
"6531"
);
dictMap
.
put
(
"住宅小区"
,
"6008"
);
dictMap
.
put
(
"养老机构"
,
"6530"
);
dictMap
.
put
(
"工业场所"
,
"6528"
);
dictMap
.
put
(
"工业场所(户外)"
,
"6529"
);
}
@Override
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/converter/EquStateConverter.java
0 → 100644
View file @
0deb2b65
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
converter
;
import
com.alibaba.excel.converters.Converter
;
import
com.alibaba.excel.enums.CellDataTypeEnum
;
import
com.alibaba.excel.metadata.CellData
;
import
com.alibaba.excel.metadata.GlobalConfiguration
;
import
com.alibaba.excel.metadata.property.ExcelContentProperty
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
EquStateConverter
implements
Converter
<
String
>
{
private
static
final
Map
<
String
,
String
>
equipmentMap
=
new
HashMap
<>();
static
{
equipmentMap
.
put
(
"未登记"
,
"0"
);
equipmentMap
.
put
(
"在用"
,
"1"
);
equipmentMap
.
put
(
"停用"
,
"2"
);
equipmentMap
.
put
(
"报废"
,
"3"
);
equipmentMap
.
put
(
"注销"
,
"4"
);
}
@Override
public
Class
<?>
supportJavaTypeKey
()
{
// 实体类中对象属性类型
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
return
equipmentMap
.
getOrDefault
(
cellValue
,
null
);
}
@Override
public
CellData
convertToExcelData
(
String
o
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
return
new
CellData
(
""
);
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/converter/UsePlaceConverter.java
0 → 100644
View file @
0deb2b65
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
converter
;
import
com.alibaba.excel.converters.Converter
;
import
com.alibaba.excel.enums.CellDataTypeEnum
;
import
com.alibaba.excel.metadata.CellData
;
import
com.alibaba.excel.metadata.GlobalConfiguration
;
import
com.alibaba.excel.metadata.property.ExcelContentProperty
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
UsePlaceConverter
implements
Converter
<
String
>
{
private
static
final
Map
<
String
,
String
>
dictMap
=
new
HashMap
<>();
static
{
dictMap
.
put
(
"游乐场所"
,
"6532"
);
dictMap
.
put
(
"商业单位"
,
"6009"
);
dictMap
.
put
(
"学校"
,
"6010"
);
dictMap
.
put
(
"政府机关"
,
"6012"
);
dictMap
.
put
(
"医疗机构"
,
"6011"
);
dictMap
.
put
(
"公共场所"
,
"6013"
);
dictMap
.
put
(
"旅游景区"
,
"6531"
);
dictMap
.
put
(
"住宅小区"
,
"6008"
);
dictMap
.
put
(
"养老机构"
,
"6530"
);
dictMap
.
put
(
"工业场所"
,
"6528"
);
dictMap
.
put
(
"工业场所(户外)"
,
"6529"
);
dictMap
.
put
(
"地铁站"
,
"6641"
);
dictMap
.
put
(
"机场"
,
"6642"
);
dictMap
.
put
(
"车站"
,
"6643"
);
dictMap
.
put
(
"商业综合体"
,
"6644"
);
dictMap
.
put
(
"超市"
,
"6645"
);
dictMap
.
put
(
"餐饮场所"
,
"6646"
);
dictMap
.
put
(
"其他"
,
"6647"
);
}
@Override
public
Class
<?>
supportJavaTypeKey
()
{
// 实体类中对象属性类型
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
return
dictMap
.
getOrDefault
(
cellValue
,
null
);
}
@Override
public
CellData
convertToExcelData
(
String
o
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
return
new
CellData
(
""
);
}
public
static
void
main
(
String
[]
args
)
{
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/dto/XiAnElevatorExcelDto.java
View file @
0deb2b65
...
...
@@ -110,7 +110,7 @@ public class XiAnElevatorExcelDto extends BaseDto {
private
String
longitudeLatitude
;
@ApiModelProperty
(
value
=
"使用场所"
)
@ExcelProperty
(
value
=
"使用场所"
,
converter
=
DictParams
Converter
.
class
)
@ExcelProperty
(
value
=
"使用场所"
,
converter
=
UsePlace
Converter
.
class
)
private
String
usePlace
;
@ApiModelProperty
(
value
=
"安全管理员"
)
...
...
@@ -384,4 +384,8 @@ public class XiAnElevatorExcelDto extends BaseDto {
@ExcelProperty
(
value
=
"审批通过时间"
)
@DateTimeFormat
(
"yyyy-MM-dd HH:mm:ss"
)
private
String
approvalDate
;
@ApiModelProperty
(
value
=
"电梯状态"
)
@ExcelProperty
(
value
=
"电梯状态"
,
converter
=
EquStateConverter
.
class
)
private
String
equState
;
}
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
View file @
0deb2b65
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/ESEquipmentCategoryDto.java
View file @
0deb2b65
...
...
@@ -188,6 +188,6 @@ public class ESEquipmentCategoryDto {
/**
* 是否可以做业务-西安电梯导入用(false-否,true-是)
*/
@Field
(
type
=
FieldType
.
Boolean
)
@Field
(
type
=
FieldType
.
Boolean
,
name
=
"IS_DO_BUSINESS"
)
private
Boolean
IS_DO_BUSINESS
;
}
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 @
0deb2b65
...
...
@@ -80,6 +80,7 @@ import static com.alibaba.fastjson.JSON.toJSONString;
public
class
DataDockServiceImpl
{
private
final
SnowflakeIdUtil
sequence
;
private
final
ESEquipmentCategory
esEquipmentCategory
;
private
final
SuperviseInfoMapper
superviseInfoMapper
;
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
private
final
IIdxBizJgUseInfoService
idxBizJgUseInfoService
;
private
final
IIdxBizJgProjectContraptionService
idxBizJgProjectContraptionService
;
...
...
@@ -284,7 +285,7 @@ public class DataDockServiceImpl {
String
streetName
=
Objects
.
toString
(
equ
.
get
(
"factoryUseSiteStreet"
),
""
);
String
streetCode
=
""
;
if
(!
ValidationUtil
.
isEmpty
(
streetName
))
{
distric
tCode
=
getRegionCode
(
streetName
,
"STREET"
);
stree
tCode
=
getRegionCode
(
streetName
,
"STREET"
);
}
useInfo
.
setProvince
(
provinceCode
);
useInfo
.
setProvinceName
(
provinceName
);
...
...
@@ -298,6 +299,7 @@ public class DataDockServiceImpl {
equ
.
put
(
"city"
,
useInfo
.
getCity
());
equ
.
put
(
"county"
,
useInfo
.
getCounty
());
equ
.
put
(
"factoryUseSiteStreet"
,
streetCode
);
equ
.
put
(
"isXixian"
,
"0"
);
if
(!
ValidationUtil
.
isEmpty
(
Objects
.
toString
(
equ
.
get
(
"longitudeLatitude"
))))
{
String
[]
parts
=
Objects
.
toString
(
equ
.
get
(
"longitudeLatitude"
),
""
).
split
(
","
,
-
1
);
String
latitude
=
parts
.
length
>
0
?
parts
[
0
].
trim
()
:
""
;
...
...
@@ -312,7 +314,7 @@ public class DataDockServiceImpl {
useInfo
.
setUseUnitCreditCode
(
Objects
.
toString
(
equ
.
get
(
"useUnitCode"
),
""
).
trim
());
useInfo
.
setUseUnitName
(
Objects
.
toString
(
equ
.
get
(
"useUnit"
),
""
).
trim
());
useInfo
.
setRemark
(
remark
);
useInfo
.
setEquState
(
EquimentEnum
.
ZAIYONG
.
getCode
()+
""
);
//
useInfo.setEquState(EquimentEnum.ZAIYONG.getCode()+"");
useInfo
.
setProjectContraptionId
(
Objects
.
toString
(
equ
.
get
(
"projectContraptionId"
),
""
));
useInfo
.
setIsNotXiXian
(
"0"
);
idxBizJgUseInfoService
.
save
(
useInfo
);
...
...
@@ -320,6 +322,7 @@ public class DataDockServiceImpl {
equ
.
put
(
"useUnitCreditCode"
,
useInfo
.
getUseUnitCreditCode
());
equ
.
put
(
"useUnitName"
,
useInfo
.
getUseUnitName
());
equ
.
put
(
"isNotXiXian"
,
"0"
);
equ
.
put
(
"DATA_SOURCE"
,
useInfo
.
getDataSource
());
}
}
...
...
@@ -443,6 +446,7 @@ public class DataDockServiceImpl {
}
}
idxBizJgSupervisionInfoService
.
save
(
supervisionInfo
);
equ
.
put
(
"orgBranchCode"
,
supervisionInfo
.
getOrgBranchCode
()
+
"_"
+
supervisionInfo
.
getOrgBranchName
());
}
/**
...
...
@@ -645,7 +649,7 @@ public class DataDockServiceImpl {
long
time
=
Timestamp
.
valueOf
(
map
.
get
(
"REC_DATE"
).
toString
().
substring
(
0
,
19
)).
getTime
();
equipmentCategoryDto
.
setREC_DATE
(
time
);
equipmentCategoryDto
.
setSTATUS
(
"已认领"
);
equipmentCategoryDto
.
setIS_DO_BUSINESS
(
false
);
equipmentCategoryDto
.
setIS_DO_BUSINESS
(
Boolean
.
FALSE
);
equipmentCategoryDto
.
setIS_COMPLETE_XA
(
Objects
.
equals
(
"0"
,
isCompleteXa
));
esEquipmentCategory
.
save
(
equipmentCategoryDto
);
}
...
...
@@ -2192,6 +2196,7 @@ public class DataDockServiceImpl {
try
{
if
(!
equList
.
isEmpty
())
{
saveUseInfo
(
equ
,
record
,
dataSource
,
remark
);
saveDesignInfo
(
equ
,
record
);
saveFactoryInfo
(
equ
,
record
);
saveRegisterInfo
(
equ
,
record
,
equList
);
saveSupervisionInfo
(
equ
,
record
);
...
...
@@ -2209,6 +2214,7 @@ public class DataDockServiceImpl {
}
}
catch
(
Exception
e
)
{
esEquipmentCategory
.
deleteById
(
record
);
superviseInfoMapper
.
deleteDataAll
(
Collections
.
singletonList
(
record
));
log
.
error
(
"{}数据:保存时出现异常,对应数据:{}"
,
dataSource
,
JSONObject
.
toJSONString
(
equ
),
e
);
throw
new
RuntimeException
(
"保存电梯数据失败"
,
e
);
}
...
...
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