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
f2936d67
Commit
f2936d67
authored
Sep 11, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(openapi/jg):西安数据对接接口
parent
25db81a0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
770 additions
and
45 deletions
+770
-45
ResponseHelper.java
...yeejoin/amos/api/common/restful/utils/ResponseHelper.java
+27
-11
OpenApiControllerAop.java
...om/yeejoin/amos/api/openapi/aop/OpenApiControllerAop.java
+4
-1
XiAnDataDockController.java
...n/amos/api/openapi/controller/XiAnDataDockController.java
+56
-0
EquCategoryConverter.java
...join/amos/api/openapi/converter/EquCategoryConverter.java
+79
-0
EquCodeTypeConverter.java
...join/amos/api/openapi/converter/EquCodeTypeConverter.java
+53
-0
EquDefineConverter.java
...eejoin/amos/api/openapi/converter/EquDefineConverter.java
+102
-0
EquListConverter.java
.../yeejoin/amos/api/openapi/converter/EquListConverter.java
+51
-0
ImportedConverter.java
...yeejoin/amos/api/openapi/converter/ImportedConverter.java
+53
-0
XiAnEquipInfoExcelDto.java
...m/yeejoin/amos/api/openapi/dto/XiAnEquipInfoExcelDto.java
+0
-0
TzsJgServiceFeignClient.java
...ejoin/amos/api/openapi/feign/TzsJgServiceFeignClient.java
+33
-12
XiAnDataDockServiceImpl.java
...oin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
+0
-0
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+2
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+7
-0
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+7
-0
XiAnDataDockController.java
...boot/module/jg/biz/controller/XiAnDataDockController.java
+42
-0
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+10
-2
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+35
-19
XiAnDataDockServiceImpl.java
...t/module/jg/biz/service/impl/XiAnDataDockServiceImpl.java
+209
-0
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/common/restful/utils/ResponseHelper.java
View file @
f2936d67
...
@@ -2,15 +2,31 @@ package com.yeejoin.amos.api.common.restful.utils;
...
@@ -2,15 +2,31 @@ package com.yeejoin.amos.api.common.restful.utils;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
public
class
ResponseHelper
public
class
ResponseHelper
{
{
public
static
<
T
>
ResponseModel
<
T
>
buildResponse
(
T
t
)
{
public
static
<
T
>
ResponseModel
<
T
>
buildResponse
(
T
t
)
{
ResponseModel
<
T
>
response
=
new
ResponseModel
<>();
ResponseModel
<
T
>
response
=
new
ResponseModel
<>();
response
.
setResult
(
t
);
response
.
setResult
(
t
);
response
.
setMessage
(
"ok"
);
response
.
setMessage
(
"ok"
);
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
response
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
response
;
return
response
;
}
}
/**
* 失败的响应
*
* @param result 接口执行结果
* @param errorMessage 错误信息
* @param status HttpStatus 响应状态码
* @param <T>
* @return 响应
*/
public
static
<
T
>
ResponseModel
<
T
>
buildFailureResponse
(
T
result
,
String
errorMessage
,
HttpStatus
status
)
{
ResponseModel
<
T
>
response
=
new
ResponseModel
<>();
response
.
setStatus
(
status
.
value
());
response
.
setMessage
(
errorMessage
);
response
.
setResult
(
result
);
return
response
;
}
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/aop/OpenApiControllerAop.java
View file @
f2936d67
...
@@ -41,7 +41,10 @@ public class OpenApiControllerAop {
...
@@ -41,7 +41,10 @@ public class OpenApiControllerAop {
HttpServletRequest
request
=
attributes
.
getRequest
();
HttpServletRequest
request
=
attributes
.
getRequest
();
logger
.
info
(
"request>>>"
,
request
);
logger
.
info
(
"request>>>"
,
request
);
// 不需要添加请求头的接口
// 不需要添加请求头的接口
String
[]
url
=
new
String
[]{
"/api/user/selectInfo"
,
"/api/user/save/curCompany"
,
"/bizToken/applyToken"
,
"/openapi/bizToken/getAppId"
,
"/lift/upload"
,
"/lift/status"
,
"/lift/run"
,
"/lift/fault"
,
"/lift/video/preview"
,
"/cylinderPage/serviceProvider"
,
"/cylinderPage/getTableInfo"
,
"/cylinderPage/initCylinderNum"
,
"/openapi/appId/setAppId"
};
String
[]
url
=
new
String
[]{
"/api/user/selectInfo"
,
"/api/user/save/curCompany"
,
"/bizToken/applyToken"
,
"/openapi/bizToken/getAppId"
,
"/lift/upload"
,
"/lift/status"
,
"/lift/run"
,
"/lift/fault"
,
"/lift/video/preview"
,
"/cylinderPage/serviceProvider"
,
"/cylinderPage/getTableInfo"
,
"/cylinderPage/initCylinderNum"
,
"/openapi/appId/setAppId"
,
"/openapi/xi-an/importData"
};
// 获取请求路径
// 获取请求路径
for
(
String
uri
:
url
)
{
for
(
String
uri
:
url
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/controller/XiAnDataDockController.java
0 → 100644
View file @
f2936d67
package
com
.
yeejoin
.
amos
.
api
.
openapi
.
controller
;
import
com.yeejoin.amos.api.openapi.service.XiAnDataDockServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.FilenameUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
@RestController
@Api
(
tags
=
"西安数据对接 API"
)
@RequestMapping
(
value
=
"/xi-an"
)
public
class
XiAnDataDockController
{
private
final
XiAnDataDockServiceImpl
xiAnDataDockService
;
public
XiAnDataDockController
(
XiAnDataDockServiceImpl
xiAnDataDockService
)
{
this
.
xiAnDataDockService
=
xiAnDataDockService
;
}
/**
* 批量导入设备数据的接口
*
* @param file 上传的文件
* @return ResponseModel 封装的响应数据
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/importData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备批量导入"
,
notes
=
"导入多个设备的数据文件"
)
public
Object
importPressureData
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
// 校验文件是否为空
if
(
file
.
isEmpty
())
{
return
ResponseHelper
.
buildResponse
(
"文件不能为空"
);
}
// 校验文件类型为 Excel
String
contentType
=
file
.
getContentType
();
String
fileExtension
=
FilenameUtils
.
getExtension
(
file
.
getOriginalFilename
());
// 校验 Excel 文件的 MIME type 和扩展名
if
(!(
"application/vnd.ms-excel"
.
equals
(
contentType
)
||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
.
equals
(
contentType
))
||
!(
"xls"
.
equalsIgnoreCase
(
fileExtension
)
||
"xlsx"
.
equalsIgnoreCase
(
fileExtension
)))
{
return
ResponseHelper
.
buildResponse
(
"文件类型必须是 Excel 文件"
);
}
return
xiAnDataDockService
.
importEquipmentData
(
file
);
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/converter/EquCategoryConverter.java
0 → 100644
View file @
f2936d67
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
EquCategoryConverter
implements
Converter
<
String
>
{
private
static
final
Map
<
String
,
String
>
equipmentMap
=
new
HashMap
<>();
static
{
// 填充映射关系
equipmentMap
.
put
(
"承压蒸汽锅炉"
,
"1100"
);
equipmentMap
.
put
(
"承压热水锅炉"
,
"1200"
);
equipmentMap
.
put
(
"有机热载体锅炉"
,
"1300"
);
equipmentMap
.
put
(
"移动式压力容器"
,
"2200"
);
equipmentMap
.
put
(
"气瓶"
,
"2300"
);
equipmentMap
.
put
(
"氧舱"
,
"2400"
);
equipmentMap
.
put
(
"桥式起重机"
,
"4100"
);
equipmentMap
.
put
(
"门式起重机"
,
"4200"
);
equipmentMap
.
put
(
"塔式起重机"
,
"4300"
);
equipmentMap
.
put
(
"流动式起重机"
,
"4400"
);
equipmentMap
.
put
(
"门座式起重机"
,
"4700"
);
equipmentMap
.
put
(
"升降机"
,
"4800"
);
equipmentMap
.
put
(
"缆索式起重机"
,
"4900"
);
equipmentMap
.
put
(
"桅杆式起重机"
,
"4A00"
);
equipmentMap
.
put
(
"机械式停车设备"
,
"4D00"
);
equipmentMap
.
put
(
"机动工业车辆"
,
"5100"
);
equipmentMap
.
put
(
"非公路用旅游观光车辆"
,
"5200"
);
equipmentMap
.
put
(
"观览车类"
,
"6100"
);
equipmentMap
.
put
(
"滑行车类"
,
"6200"
);
equipmentMap
.
put
(
"固定式压力容器"
,
"2100"
);
equipmentMap
.
put
(
"架空游览车类"
,
"6300"
);
equipmentMap
.
put
(
"陀螺类"
,
"6400"
);
equipmentMap
.
put
(
"飞行塔类"
,
"6500"
);
equipmentMap
.
put
(
"转马类"
,
"6600"
);
equipmentMap
.
put
(
"自控飞机类"
,
"6700"
);
equipmentMap
.
put
(
"赛车类"
,
"6800"
);
equipmentMap
.
put
(
"小火车类"
,
"6900"
);
equipmentMap
.
put
(
"碰碰车类"
,
"6A00"
);
equipmentMap
.
put
(
"滑道类"
,
"6B00"
);
equipmentMap
.
put
(
"无动力游乐设施"
,
"6E00"
);
equipmentMap
.
put
(
"工业管道"
,
"8300"
);
equipmentMap
.
put
(
"客运架空索道"
,
"9100"
);
equipmentMap
.
put
(
"客运缆车"
,
"9200"
);
equipmentMap
.
put
(
"客运拖牵索道"
,
"9300"
);
equipmentMap
.
put
(
"水上游乐设施类"
,
"6D00"
);
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
return
equipmentMap
.
getOrDefault
(
cellValue
,
null
);
}
@Override
public
Class
<?>
supportJavaTypeKey
()
{
// 实体类中对象属性类型
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@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/EquCodeTypeConverter.java
0 → 100644
View file @
f2936d67
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
;
public
class
EquCodeTypeConverter
implements
Converter
<
String
>
{
private
static
final
String
HAVE
=
"有"
;
private
static
final
String
NOT
=
"无"
;
@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中的值,将其转换为预期的数值
if
(
HAVE
.
equals
(
cellValue
))
{
return
"1"
;
}
else
if
(
NOT
.
equals
(
cellValue
))
{
return
"2"
;
}
return
null
;
}
@Override
public
CellData
convertToExcelData
(
String
o
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
// 判断实体类中获取的值,转换为Excel预期的值,并封装为CellData对象
if
(
o
==
null
)
{
return
new
CellData
(
""
);
}
else
if
(
o
.
equals
(
"1"
))
{
return
new
CellData
(
HAVE
);
}
else
if
(
o
.
equals
(
"2"
))
{
return
new
CellData
(
NOT
);
}
return
new
CellData
(
""
);
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/converter/EquDefineConverter.java
0 → 100644
View file @
f2936d67
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
EquDefineConverter
implements
Converter
<
String
>
{
private
static
final
Map
<
String
,
String
>
equipmentMap
=
new
HashMap
<>();
static
{
// 填充映射关系
equipmentMap
.
put
(
"有机热载体气相炉"
,
"1310"
);
equipmentMap
.
put
(
"有机热载体液相炉"
,
"1320"
);
equipmentMap
.
put
(
"超高压容器"
,
"2110"
);
equipmentMap
.
put
(
"第三类压力容器"
,
"2130"
);
equipmentMap
.
put
(
"第二类压力容器"
,
"2150"
);
equipmentMap
.
put
(
"第一类压力容器"
,
"2170"
);
equipmentMap
.
put
(
"铁路罐车"
,
"2210"
);
equipmentMap
.
put
(
"汽车罐车"
,
"2220"
);
equipmentMap
.
put
(
"长管拖车"
,
"2230"
);
equipmentMap
.
put
(
"罐式集装箱"
,
"2240"
);
equipmentMap
.
put
(
"管束式集装箱"
,
"2250"
);
equipmentMap
.
put
(
"无缝气瓶"
,
"2310"
);
equipmentMap
.
put
(
"焊接气瓶"
,
"2320"
);
equipmentMap
.
put
(
"特种气瓶(内装填料气瓶、纤维缠绕气瓶、低温绝热气瓶)"
,
"23T0"
);
equipmentMap
.
put
(
"医用氧舱"
,
"2410"
);
equipmentMap
.
put
(
"高气压舱"
,
"2420"
);
equipmentMap
.
put
(
"通用桥式起重机"
,
"4110"
);
equipmentMap
.
put
(
"防爆桥式起重机"
,
"4130"
);
equipmentMap
.
put
(
"绝缘桥式起重机"
,
"4140"
);
equipmentMap
.
put
(
"冶金桥式起重机"
,
"4150"
);
equipmentMap
.
put
(
"电动葫芦桥式起重机"
,
"4190"
);
equipmentMap
.
put
(
"通用门式起重机"
,
"4210"
);
equipmentMap
.
put
(
"防爆门式起重机"
,
"4220"
);
equipmentMap
.
put
(
"轨道式集装箱门式起重机"
,
"4230"
);
equipmentMap
.
put
(
"轮胎式集装箱门式起重机"
,
"4240"
);
equipmentMap
.
put
(
"岸边集装箱起重机"
,
"4250"
);
equipmentMap
.
put
(
"造船门式起重机"
,
"4260"
);
equipmentMap
.
put
(
"电动葫芦门式起重机"
,
"4270"
);
equipmentMap
.
put
(
"装卸桥"
,
"4280"
);
equipmentMap
.
put
(
"架桥机"
,
"4290"
);
equipmentMap
.
put
(
"普通塔式起重机"
,
"4310"
);
equipmentMap
.
put
(
"电站塔式起重机"
,
"4320"
);
equipmentMap
.
put
(
"轮胎起重机"
,
"4410"
);
equipmentMap
.
put
(
"履带起重机"
,
"4420"
);
equipmentMap
.
put
(
"集装箱正面吊运起重机"
,
"4440"
);
equipmentMap
.
put
(
"铁路起重机"
,
"4450"
);
equipmentMap
.
put
(
"门座起重机"
,
"4710"
);
equipmentMap
.
put
(
"固定式起重机"
,
"4760"
);
equipmentMap
.
put
(
"施工升降机"
,
"4860"
);
equipmentMap
.
put
(
"简易升降机"
,
"4870"
);
equipmentMap
.
put
(
"叉车"
,
"5110"
);
equipmentMap
.
put
(
"峡谷漂流系列"
,
"6D10"
);
equipmentMap
.
put
(
"水滑梯系列"
,
"6D20"
);
equipmentMap
.
put
(
"碰碰船系列"
,
"6D40"
);
equipmentMap
.
put
(
"蹦极系列"
,
"6E10"
);
equipmentMap
.
put
(
"滑索系列"
,
"6E20"
);
equipmentMap
.
put
(
"空中飞人系列"
,
"6E30"
);
equipmentMap
.
put
(
"系留式观光气球系列"
,
"6E40"
);
equipmentMap
.
put
(
"工艺管道"
,
"8310"
);
equipmentMap
.
put
(
"动力管道"
,
"8320"
);
equipmentMap
.
put
(
"制冷管道"
,
"8330"
);
equipmentMap
.
put
(
"往复式客运架空索道"
,
"9110"
);
equipmentMap
.
put
(
"循环式客运架空索道"
,
"9120"
);
equipmentMap
.
put
(
"往复式客运缆车"
,
"9210"
);
equipmentMap
.
put
(
"循环式客运缆车"
,
"9220"
);
equipmentMap
.
put
(
"低位客运拖牵索道"
,
"9310"
);
equipmentMap
.
put
(
"高位客运拖牵索道"
,
"9320"
);
equipmentMap
.
put
(
"电动单梁起重机"
,
"4170"
);
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
return
equipmentMap
.
getOrDefault
(
cellValue
,
null
);
}
@Override
public
Class
<?>
supportJavaTypeKey
()
{
// 实体类中对象属性类型
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@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/EquListConverter.java
0 → 100644
View file @
f2936d67
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
EquListConverter
implements
Converter
<
String
>
{
private
static
final
Map
<
String
,
String
>
equipmentMap
=
new
HashMap
<>();
static
{
// 填充映射关系
equipmentMap
.
put
(
"起重机械"
,
"4000"
);
equipmentMap
.
put
(
"场内机动车辆"
,
"5000"
);
equipmentMap
.
put
(
"锅炉"
,
"1000"
);
equipmentMap
.
put
(
"压力容器"
,
"2000"
);
equipmentMap
.
put
(
"压力管道"
,
"8000"
);
equipmentMap
.
put
(
"大型游乐设施"
,
"6000"
);
equipmentMap
.
put
(
"客运索道"
,
"9000"
);
}
@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/ImportedConverter.java
0 → 100644
View file @
f2936d67
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
;
public
class
ImportedConverter
implements
Converter
<
String
>
{
private
static
final
String
WHETHER
=
"是"
;
private
static
final
String
NOT
=
"否"
;
@Override
public
Class
<?>
supportJavaTypeKey
()
{
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
// Excel中对应的CellData属性类型
return
CellDataTypeEnum
.
STRING
;
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
if
(
WHETHER
.
equals
(
cellValue
))
{
return
"1"
;
}
else
if
(
NOT
.
equals
(
cellValue
))
{
return
"0"
;
}
return
null
;
}
@Override
public
CellData
convertToExcelData
(
String
o
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
// 判断实体类中获取的值,转换为Excel预期的值,并封装为CellData对象
if
(
o
==
null
)
{
return
new
CellData
(
""
);
}
else
if
(
o
.
equals
(
"1"
))
{
return
new
CellData
(
WHETHER
);
}
else
if
(
o
.
equals
(
"0"
))
{
return
new
CellData
(
NOT
);
}
return
new
CellData
(
""
);
}
}
\ No newline at end of file
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/dto/XiAnEquipInfoExcelDto.java
0 → 100644
View file @
f2936d67
This diff is collapsed.
Click to expand it.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/feign/TzsJgServiceFeignClient.java
View file @
f2936d67
...
@@ -2,20 +2,19 @@ package com.yeejoin.amos.api.openapi.feign;
...
@@ -2,20 +2,19 @@ package com.yeejoin.amos.api.openapi.feign;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.api.openapi.dto.XiAnEquipInfoExcelDto
;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorModel
;
import
com.yeejoin.amos.api.openapi.face.model.ElevatorModel
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam
;
import
com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@FeignClient
(
name
=
"TZS-JG"
,
path
=
"/jg"
,
configuration
=
{
FeignConfiguration
.
class
})
@FeignClient
(
name
=
"TZS-JG
-htt
"
,
path
=
"/jg"
,
configuration
=
{
FeignConfiguration
.
class
})
public
interface
TzsJgServiceFeignClient
{
public
interface
TzsJgServiceFeignClient
{
/**
/**
...
@@ -30,6 +29,7 @@ public interface TzsJgServiceFeignClient {
...
@@ -30,6 +29,7 @@ public interface TzsJgServiceFeignClient {
/**
/**
* 字段列表查询
* 字段列表查询
*
* @param dictCode 字段类型
* @param dictCode 字段类型
* @return 列表
* @return 列表
*/
*/
...
@@ -38,22 +38,24 @@ public interface TzsJgServiceFeignClient {
...
@@ -38,22 +38,24 @@ public interface TzsJgServiceFeignClient {
/**
/**
* 根据时间范围查询
* 根据时间范围查询
* @param equCode 设备代码
*
* @param equCode 设备代码
* @param startTime 开始时间
* @param startTime 开始时间
* @param endTime 结束时间
* @param endTime
结束时间
* @return 电梯数据
* @return 电梯数据
*/
*/
@RequestMapping
(
value
=
"/equipment-register/getElevatorInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/equipment-register/getElevatorInfo"
,
method
=
RequestMethod
.
GET
)
IPage
<
ElevatorModel
>
getElevatorInfo
(
@RequestParam
(
"equCode"
)
String
equCode
,
IPage
<
ElevatorModel
>
getElevatorInfo
(
@RequestParam
(
"equCode"
)
String
equCode
,
@RequestParam
(
"startTime"
)
Date
startTime
,
@RequestParam
(
"startTime"
)
Date
startTime
,
@RequestParam
(
"startTime"
)
Date
endTime
,
@RequestParam
(
"startTime"
)
Date
endTime
,
PageParam
pageParam
);
PageParam
pageParam
);
/**
/**
* 根据时间范围查询液化石油气瓶档案
* 根据时间范围查询液化石油气瓶档案
* @param equCode 设备代码
*
* @param equCode 设备代码
* @param startTime 开始时间
* @param startTime 开始时间
* @param endTime 结束时间
* @param endTime
结束时间
* @return 电梯数据
* @return 电梯数据
*/
*/
@RequestMapping
(
value
=
"/equipment-register/getCylinderInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/equipment-register/getCylinderInfo"
,
method
=
RequestMethod
.
GET
)
...
@@ -64,6 +66,7 @@ public interface TzsJgServiceFeignClient {
...
@@ -64,6 +66,7 @@ public interface TzsJgServiceFeignClient {
/**
/**
* 查询气站信息
* 查询气站信息
*
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/equipment-register/getCylinderStationInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/equipment-register/getCylinderStationInfo"
,
method
=
RequestMethod
.
GET
)
...
@@ -71,4 +74,22 @@ public interface TzsJgServiceFeignClient {
...
@@ -71,4 +74,22 @@ public interface TzsJgServiceFeignClient {
@RequestMapping
(
value
=
"/equipment-register/getVehicleCylinderInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/equipment-register/getVehicleCylinderInfo"
,
method
=
RequestMethod
.
GET
)
List
<
Map
<
String
,
Object
>>
getVehicleCylinderInfo
(
String
useCode
);
List
<
Map
<
String
,
Object
>>
getVehicleCylinderInfo
(
String
useCode
);
/**
* 批量保存西安上传的设备数据
*
* @param equipInfoExcelDtos
* @return
*/
@RequestMapping
(
value
=
"/xi-an/saveEquipmentData"
,
method
=
RequestMethod
.
POST
)
Object
saveEquipmentData
(
@RequestBody
List
<
XiAnEquipInfoExcelDto
>
equipInfoExcelDtos
);
/**
* 设备代码唯一性检查
*
* @param equCode
* @return
*/
@RequestMapping
(
value
=
"/common/checkEquCodeUniqueness"
,
method
=
RequestMethod
.
GET
)
Boolean
selectByEquCodeAndClaimStatus
(
@RequestParam
(
"equCode"
)
String
equCode
);
}
}
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
0 → 100644
View file @
f2936d67
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
f2936d67
...
@@ -25,6 +25,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
...
@@ -25,6 +25,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List
<
Map
<
String
,
Object
>>
getSecurityAdmin
(
String
companyCode
,
List
<
String
>
post
);
List
<
Map
<
String
,
Object
>>
getSecurityAdmin
(
String
companyCode
,
List
<
String
>
post
);
Integer
checkEquCodeUniqueness
(
String
equCode
);
Map
<
String
,
Object
>
getUserInfo
(
String
sequenceNbr
);
Map
<
String
,
Object
>
getUserInfo
(
String
sequenceNbr
);
Map
<
String
,
Object
>
getEnterpriseInfo
(
String
useCode
);
Map
<
String
,
Object
>
getEnterpriseInfo
(
String
useCode
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
f2936d67
...
@@ -41,6 +41,13 @@
...
@@ -41,6 +41,13 @@
)
)
</if>
</if>
</select>
</select>
<select
id=
"checkEquCodeUniqueness"
resultType=
"java.lang.Integer"
>
SELECT COUNT(*)
FROM idx_biz_jg_register_info jri
JOIN idx_biz_jg_other_info joi ON jri.record = joi.record
WHERE jri.equ_code = #{equCode}
AND joi.claim_status = '已认领'
</select>
<select
id=
"getUserInfo"
resultType=
"java.util.Map"
>
<select
id=
"getUserInfo"
resultType=
"java.util.Map"
>
SELECT
SELECT
phone,
phone,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/CommonController.java
View file @
f2936d67
...
@@ -626,4 +626,11 @@ public class CommonController extends BaseController {
...
@@ -626,4 +626,11 @@ public class CommonController extends BaseController {
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
return
ResponseHelper
.
buildResponse
(
commonService
.
getLatestJgUseRegistrationManage
(
company
.
getCompanyCode
(),
equDefineCode
));
return
ResponseHelper
.
buildResponse
(
commonService
.
getLatestJgUseRegistrationManage
(
company
.
getCompanyCode
(),
equDefineCode
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/checkEquCodeUniqueness"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"检查设备代码的唯一性"
,
notes
=
"检查设备代码的唯一性"
)
public
Boolean
checkEquCodeUniqueness
(
@RequestParam
(
"equCode"
)
String
equCode
)
{
return
commonService
.
checkEquCodeUniqueness
(
equCode
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/XiAnDataDockController.java
0 → 100644
View file @
f2936d67
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.XiAnDataDockServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"西安数据对接 API"
)
@RequestMapping
(
value
=
"/xi-an"
)
public
class
XiAnDataDockController
{
private
final
XiAnDataDockServiceImpl
xiAnDataDockService
;
public
XiAnDataDockController
(
XiAnDataDockServiceImpl
xiAnDataDockService
)
{
this
.
xiAnDataDockService
=
xiAnDataDockService
;
}
/**
* 批量导入设备数据的接口
* @param equLists 设备数据集合
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/saveEquipmentData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备批量导入"
,
notes
=
"导入多个设备的数据文件"
)
public
ResponseModel
<?>
saveEquipmentData
(
@RequestBody
List
<
Map
<?,?>>
equLists
)
{
return
ResponseHelper
.
buildResponse
(
xiAnDataDockService
.
saveEquipmentData
(
equLists
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
f2936d67
...
@@ -38,6 +38,7 @@ public interface ICommonService {
...
@@ -38,6 +38,7 @@ public interface ICommonService {
/**
/**
* 查询所有检验检测信息
* 查询所有检验检测信息
*
* @param type 类型
* @param type 类型
* @return list
* @return list
*/
*/
...
@@ -57,7 +58,7 @@ public interface ICommonService {
...
@@ -57,7 +58,7 @@ public interface ICommonService {
void
generatePdfPrint
(
Map
<
String
,
Object
>
map
,
HttpServletResponse
response
);
void
generatePdfPrint
(
Map
<
String
,
Object
>
map
,
HttpServletResponse
response
);
byte
[]
generateSummaryOfCylinderInfo
(
Map
<
String
,
Object
>
map
,
String
wordPath
,
String
filePrefix
);
byte
[]
generateSummaryOfCylinderInfo
(
Map
<
String
,
Object
>
map
,
String
wordPath
,
String
filePrefix
);
List
<
LinkedHashMap
>
creatApproveTree
();
List
<
LinkedHashMap
>
creatApproveTree
();
...
@@ -207,7 +208,7 @@ public interface ICommonService {
...
@@ -207,7 +208,7 @@ public interface ICommonService {
*/
*/
CompanyBo
getOneCompany
(
String
companyCode
);
CompanyBo
getOneCompany
(
String
companyCode
);
Integer
checkFactoryNumUniquenessForVehicleCylinder
(
String
factoryNum
,
String
sequenceNbr
);
Integer
checkFactoryNumUniquenessForVehicleCylinder
(
String
factoryNum
,
String
sequenceNbr
);
/**
/**
* 更新单位类型缓存
* 更新单位类型缓存
...
@@ -219,4 +220,11 @@ public interface ICommonService {
...
@@ -219,4 +220,11 @@ public interface ICommonService {
void
historicalDataProcessingOfPressurePipeline
();
void
historicalDataProcessingOfPressurePipeline
();
JgUseRegistrationManage
getLatestJgUseRegistrationManage
(
String
useUnitCreditCode
,
String
equCategoryCode
);
JgUseRegistrationManage
getLatestJgUseRegistrationManage
(
String
useUnitCreditCode
,
String
equCategoryCode
);
/**
* 检查设备代码的唯一性
* @param equCode
* @return
*/
Boolean
checkEquCodeUniqueness
(
String
equCode
);
}
}
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 @
f2936d67
...
@@ -153,7 +153,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -153,7 +153,7 @@ public class CommonServiceImpl implements ICommonService {
// 业务通用发起——基本信息
// 业务通用发起——基本信息
private
static
final
String
basic
=
"basic"
;
private
static
final
String
basic
=
"basic"
;
private
static
final
String
HISTORY_EQU_TYPE
=
"historyEquType"
;
private
static
final
String
HISTORY_EQU_TYPE
=
"historyEquType"
;
private
static
final
String
SECOND
=
"second"
;
private
static
final
String
SECOND
=
"second"
;
// 业务通用发起——告知单详情
// 业务通用发起——告知单详情
private
static
final
String
notice
=
"notice"
;
private
static
final
String
notice
=
"notice"
;
// 业务通用发起——技术参数-改造变更登记使用
// 业务通用发起——技术参数-改造变更登记使用
...
@@ -809,7 +809,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -809,7 +809,7 @@ public class CommonServiceImpl implements ICommonService {
}
}
List
<
String
>
post
=
new
ArrayList
<>();
List
<
String
>
post
=
new
ArrayList
<>();
if
(
type
.
equals
(
"use"
))
{
if
(
type
.
equals
(
"use"
))
{
post
.
add
(
"6617"
)
;
//安全管理员
post
.
add
(
"6617"
);
//安全管理员
}
}
if
(
type
.
equals
(
"jyjc"
))
{
if
(
type
.
equals
(
"jyjc"
))
{
post
.
add
(
"66151"
);
//检验人员
post
.
add
(
"66151"
);
//检验人员
...
@@ -946,7 +946,8 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -946,7 +946,8 @@ public class CommonServiceImpl implements ICommonService {
/**
/**
* 使用登记证套打生成Word
* 使用登记证套打生成Word
* @param map 参数
*
* @param map 参数
* @param response 返回值
* @param response 返回值
*/
*/
public
void
generateCertificateReportDoc
(
Map
<
String
,
Object
>
map
,
HttpServletResponse
response
)
{
public
void
generateCertificateReportDoc
(
Map
<
String
,
Object
>
map
,
HttpServletResponse
response
)
{
...
@@ -1209,13 +1210,13 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1209,13 +1210,13 @@ public class CommonServiceImpl implements ICommonService {
provideMap
.
put
(
YZBG_PAGE_ID
,
noticeObj
);
provideMap
.
put
(
YZBG_PAGE_ID
,
noticeObj
);
JSONObject
jsonObject
=
new
JSONObject
(
provideMap
);
JSONObject
jsonObject
=
new
JSONObject
(
provideMap
);
return
jgChangeRegistrationTransferService
.
createTransfer
(
submitType
,
jsonObject
,
reginParams
);
return
jgChangeRegistrationTransferService
.
createTransfer
(
submitType
,
jsonObject
,
reginParams
);
}
else
if
(
type
.
equals
(
ApplicationFormTypeEnum
.
DWBG
.
getBusinessCode
())
&&
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"equCategory"
))
&&
CylinderTypeEnum
.
SPECIAL_CYLINDER
.
getCode
().
equals
(
basicObj
.
get
(
"equCategory"
).
toString
()))
{
}
else
if
(
type
.
equals
(
ApplicationFormTypeEnum
.
DWBG
.
getBusinessCode
())
&&
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"equCategory"
))
&&
CylinderTypeEnum
.
SPECIAL_CYLINDER
.
getCode
().
equals
(
basicObj
.
get
(
"equCategory"
).
toString
()))
{
noticeObj
.
put
(
"submit"
,
submitType
);
noticeObj
.
put
(
"submit"
,
submitType
);
noticeObj
.
put
(
"formType"
,
"add"
);
noticeObj
.
put
(
"formType"
,
"add"
);
noticeObj
.
put
(
"receiveOrgCode"
,
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
?
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
:
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode1"
)));
noticeObj
.
put
(
"receiveOrgCode"
,
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
?
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
:
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode1"
)));
JSONObject
jsonObject
=
new
JSONObject
(
noticeObj
);
JSONObject
jsonObject
=
new
JSONObject
(
noticeObj
);
return
jgChangeVehicleRegistrationUnitService
.
saveMessage
(
jsonObject
,
reginParams
);
return
jgChangeVehicleRegistrationUnitService
.
saveMessage
(
jsonObject
,
reginParams
);
}
else
if
(
type
.
equals
(
ApplicationFormTypeEnum
.
DWBG
.
getBusinessCode
()))
{
}
else
if
(
type
.
equals
(
ApplicationFormTypeEnum
.
DWBG
.
getBusinessCode
()))
{
noticeObj
.
put
(
"receiveOrgCode"
,
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
?
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
:
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode1"
)));
noticeObj
.
put
(
"receiveOrgCode"
,
!
ObjectUtils
.
isEmpty
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
?
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode"
))
:
String
.
valueOf
(
basicObj
.
get
(
"receiveOrgCreditCode1"
)));
provideMap
.
put
(
DWBG_PAGE_ID
,
noticeObj
);
provideMap
.
put
(
DWBG_PAGE_ID
,
noticeObj
);
JSONObject
jsonObject
=
new
JSONObject
(
provideMap
);
JSONObject
jsonObject
=
new
JSONObject
(
provideMap
);
...
@@ -1362,6 +1363,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1362,6 +1363,7 @@ public class CommonServiceImpl implements ICommonService {
/**
/**
* 删除代办及中止流程
* 删除代办及中止流程
*
* @param businessId 业务seq
* @param businessId 业务seq
* @param instanceId 业务流程id
* @param instanceId 业务流程id
*/
*/
...
@@ -1369,13 +1371,14 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1369,13 +1371,14 @@ public class CommonServiceImpl implements ICommonService {
// 删除暂存的代办
// 删除暂存的代办
deleteTasksByRelationId
(
businessId
);
deleteTasksByRelationId
(
businessId
);
// 删除流程中的代办 及 中止流程
// 删除流程中的代办 及 中止流程
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
deleteTasksAndStopProcess
(
instanceId
,
"发起人主动删除业务单"
);
deleteTasksAndStopProcess
(
instanceId
,
"发起人主动删除业务单"
);
}
}
}
}
/**
/**
* 删除代办 -根据任务关联
* 删除代办 -根据任务关联
*
* @param relationId
* @param relationId
*/
*/
public
void
deleteTasksByRelationId
(
String
relationId
)
{
public
void
deleteTasksByRelationId
(
String
relationId
)
{
...
@@ -1750,7 +1753,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1750,7 +1753,7 @@ public class CommonServiceImpl implements ICommonService {
List
<
String
>
nextGroups
=
item
.
getNextCandidateGroups
().
get
(
actTaskDTO
.
getId
());
List
<
String
>
nextGroups
=
item
.
getNextCandidateGroups
().
get
(
actTaskDTO
.
getId
());
String
join
=
String
.
join
(
","
,
nextGroups
);
String
join
=
String
.
join
(
","
,
nextGroups
);
workflowResultDto
.
setNextExecutorRoleIds
(
join
);
workflowResultDto
.
setNextExecutorRoleIds
(
join
);
List
<
String
>
nextUserIds
=
item
.
getNextTaskExecutor
().
get
(
actTaskDTO
.
getId
()).
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
String
>
nextUserIds
=
item
.
getNextTaskExecutor
().
get
(
actTaskDTO
.
getId
()).
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
String
nextUserIdsString
=
String
.
join
(
","
,
nextUserIds
);
String
nextUserIdsString
=
String
.
join
(
","
,
nextUserIds
);
workflowResultDto
.
setNextExecutorUserIds
(
nextUserIdsString
);
workflowResultDto
.
setNextExecutorUserIds
(
nextUserIdsString
);
}
}
...
@@ -1962,7 +1965,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1962,7 +1965,7 @@ public class CommonServiceImpl implements ICommonService {
* 设备分类
* 设备分类
*
*
* @param type 1,设备种类 2,设备类别 3,设备品种
* @param type 1,设备种类 2,设备类别 3,设备品种
* .c@return
*
.c@return
*/
*/
@Override
@Override
public
List
<
EquipmentCategory
>
equipmentClassification
(
String
type
)
{
public
List
<
EquipmentCategory
>
equipmentClassification
(
String
type
)
{
...
@@ -2073,18 +2076,18 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2073,18 +2076,18 @@ public class CommonServiceImpl implements ICommonService {
List
<
JgUseRegistration
>
jgUseRegistrations
=
jgUseRegistrationServiceImpl
.
getBaseMapper
().
selectList
(
queryWrapper
);
List
<
JgUseRegistration
>
jgUseRegistrations
=
jgUseRegistrationServiceImpl
.
getBaseMapper
().
selectList
(
queryWrapper
);
// 对应的历史表
// 对应的历史表
jgUseRegistrations
.
forEach
(
x
->
{
jgUseRegistrations
.
forEach
(
x
->
{
LambdaQueryWrapper
<
JgRegistrationHistory
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JgRegistrationHistory
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
x
.
getSequenceNbr
());
wrapper
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
x
.
getSequenceNbr
());
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
wrapper
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
wrapper
);
try
{
try
{
if
(
jgRegistrationHistory
.
getChangeData
().
contains
(
"8300"
)){
if
(
jgRegistrationHistory
.
getChangeData
().
contains
(
"8300"
))
{
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
if
(!
ValidationUtil
.
isEmpty
(
mapData
.
get
(
"equipmentLists"
))){
if
(!
ValidationUtil
.
isEmpty
(
mapData
.
get
(
"equipmentLists"
)))
{
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
mapData
.
get
(
"equipmentLists"
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
mapData
.
get
(
"equipmentLists"
);
// 遍历 equipmentLists,将 pipeLength 从毫米转换为米
// 遍历 equipmentLists,将 pipeLength 从毫米转换为米
equipmentLists
.
forEach
(
equ
->
{
equipmentLists
.
forEach
(
equ
->
{
String
record
=(
String
)
equ
.
get
(
"record"
);
String
record
=
(
String
)
equ
.
get
(
"record"
);
EquipTechParamPipeline
equipTechParamPipeline
=
equipTechParamPipelineMapper
.
queryTechParamInUse
(
record
);
EquipTechParamPipeline
equipTechParamPipeline
=
equipTechParamPipelineMapper
.
queryTechParamInUse
(
record
);
BigDecimal
pipeLengthInM
=
Optional
.
ofNullable
(
equipTechParamPipeline
)
BigDecimal
pipeLengthInM
=
Optional
.
ofNullable
(
equipTechParamPipeline
)
.
map
(
EquipTechParamPipeline:
:
getPipeLength
)
.
map
(
EquipTechParamPipeline:
:
getPipeLength
)
...
@@ -2095,8 +2098,8 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2095,8 +2098,8 @@ public class CommonServiceImpl implements ICommonService {
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
mapData
));
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
mapData
));
jgRegistrationHistoryService
.
getBaseMapper
().
updateById
(
jgRegistrationHistory
);
jgRegistrationHistoryService
.
getBaseMapper
().
updateById
(
jgRegistrationHistory
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"更新压力管道出现错误:{}"
,
e
.
getMessage
());
log
.
error
(
"更新压力管道出现错误:{}"
,
e
.
getMessage
());
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
...
@@ -2104,12 +2107,13 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2104,12 +2107,13 @@ public class CommonServiceImpl implements ICommonService {
/**
/**
* 生成使用登记证书唯一标识
* 生成使用登记证书唯一标识
* @param equType 包含有 设备种类 & 设备类别 & 设备品种 的map
*
* @param date 生成证日期 (不传取当前时间)
* @param equType 包含有 设备种类 & 设备类别 & 设备品种 的map
* @param date 生成证日期 (不传取当前时间)
* @param receiveCompanyCode 接收机构统一信用代码
* @param receiveCompanyCode 接收机构统一信用代码
* @return 使用登记证书唯一标识
* @return 使用登记证书唯一标识
*/
*/
public
String
generateCertificateNo
(
Map
<
String
,
String
>
equType
,
Date
date
,
String
receiveCompanyCode
)
{
public
String
generateCertificateNo
(
Map
<
String
,
String
>
equType
,
Date
date
,
String
receiveCompanyCode
)
{
String
ym
=
""
;
String
ym
=
""
;
try
{
try
{
ym
=
Optional
.
of
(
DateUtils
.
dateFormat
(
date
,
DateUtils
.
DATE_PATTERN_MM
)).
orElse
(
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
DATE_PATTERN_MM
));
ym
=
Optional
.
of
(
DateUtils
.
dateFormat
(
date
,
DateUtils
.
DATE_PATTERN_MM
)).
orElse
(
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
DATE_PATTERN_MM
));
...
@@ -2127,7 +2131,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2127,7 +2131,7 @@ public class CommonServiceImpl implements ICommonService {
* 获取最新的使用登记证书
* 获取最新的使用登记证书
*
*
* @param useUnitCreditCode 使用单位统一信用代码
* @param useUnitCreditCode 使用单位统一信用代码
* @param equDefineCode 设备类别编码
* @param equDefineCode
设备类别编码
* @return JgUseRegistrationManage
* @return JgUseRegistrationManage
*/
*/
@Override
@Override
...
@@ -2143,6 +2147,18 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2143,6 +2147,18 @@ public class CommonServiceImpl implements ICommonService {
}
}
/**
/**
* 根据设备代码检查唯一性
*
* @param equCode 设备代码
* @return
*/
@Override
public
Boolean
checkEquCodeUniqueness
(
String
equCode
)
{
Integer
count
=
commonMapper
.
checkEquCodeUniqueness
(
equCode
);
return
count
>
0
?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
}
/**
* 使用登记证编号的全库唯一校验
* 使用登记证编号的全库唯一校验
*
*
* @param useRegistrationCode 登记证编号
* @param useRegistrationCode 登记证编号
...
...
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/XiAnDataDockServiceImpl.java
0 → 100644
View file @
f2936d67
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
IdxBizJgRegisterInfoServiceImpl
.
EQU_LIST
;
@Slf4j
@Service
public
class
XiAnDataDockServiceImpl
{
@Autowired
private
ESEquipmentCategory
esEquipmentCategory
;
@Autowired
private
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
@Autowired
private
IIdxBizJgUseInfoService
idxBizJgUseInfoService
;
@Autowired
private
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoServiceImpl
;
@Autowired
private
IdxBizJgSupervisionInfoServiceImpl
idxBizJgSupervisionInfoService
;
@Autowired
private
IdxBizJgOtherInfoServiceImpl
idxBizJgOtherInfoService
;
@Autowired
private
EquipTechParamLiftingMapper
equipTechParamLiftingMapper
;
@Autowired
private
EquipTechParamVehicleMapper
equipTechParamVehicleMapper
;
@Autowired
private
EquipTechParamBoilerMapper
equipTechParamBoilerMapper
;
@Autowired
private
EquipTechParamVesselMapper
equipTechParamVesselMapper
;
@Autowired
private
EquipTechParamPipelineMapper
equipTechParamPipelineMapper
;
@Autowired
private
EquipTechParamRidesMapper
equipTechParamRidesMapper
;
@Autowired
private
EquipTechParamRopewayMapper
equipTechParamRopewayMapper
;
/**
* 保存设备信息
*
* @param equLists 数据集
* @return 保存结果
*/
public
boolean
saveEquipmentData
(
List
<
Map
<?,
?>>
equLists
)
{
equLists
.
forEach
(
equ
->
{
// 设备的唯一编码
String
record
=
UUID
.
randomUUID
().
toString
();
// 设备种类
String
equList
=
String
.
valueOf
(
equ
.
get
(
EQU_LIST
));
// 是否起重机械
boolean
isQZJX
=
EquipmentClassifityEnum
.
QZJX
.
getCode
().
equals
(
equList
);
// 是否场内机动车辆
boolean
isCNJDXL
=
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
equList
);
// 是否锅炉
boolean
isGL
=
EquipmentClassifityEnum
.
GL
.
getCode
().
equals
(
equList
);
// 是否压力容器
boolean
isYLRQ
=
EquipmentClassifityEnum
.
YLRQ
.
getCode
().
equals
(
equList
);
// 是否压力管道
boolean
isYLGD
=
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equList
);
// 是否大型游乐设施
boolean
isDXYNSS
=
EquipmentClassifityEnum
.
YLSS
.
getCode
().
equals
(
equList
);
// 是否客运索道
boolean
isKYSD
=
EquipmentClassifityEnum
.
KYSD
.
getCode
().
equals
(
equList
);
// 使用信息
IdxBizJgUseInfo
useInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgUseInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
useInfo
))
{
useInfo
.
setRecDate
(
new
Date
());
useInfo
.
setRecord
(
record
);
useInfo
.
setDataSource
(
"jg_his_xx"
);
useInfo
.
setIsNotEs
(
"1"
);
useInfo
.
setIsIntoManagement
(
Boolean
.
FALSE
);
useInfo
.
setUseUnitCreditCode
(
String
.
valueOf
(
equ
.
get
(
"useUnitCode"
)));
useInfo
.
setUseUnitName
(
String
.
valueOf
(
equ
.
get
(
"useUnit"
)));
// if("8300".equals(equCategory)) { todo
// useInfo.setProjectContraption(((String) equipmentInfoForm.get("PROJECT_CONTRAPTION")).trim());
// }
idxBizJgUseInfoService
.
save
(
useInfo
);
}
// 设计信息
IdxBizJgDesignInfo
designInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgDesignInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
designInfo
))
{
designInfo
.
setRecord
(
record
);
designInfo
.
setRecDate
(
new
Date
());
idxBizJgDesignInfoService
.
save
(
designInfo
);
}
// 制造信息
IdxBizJgFactoryInfo
factoryInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgFactoryInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
))
{
factoryInfo
.
setRecord
(
record
);
factoryInfo
.
setRecDate
(
new
Date
());
idxBizJgFactoryInfoService
.
save
(
factoryInfo
);
}
// 注册登记信息
IdxBizJgRegisterInfo
registerInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgRegisterInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
))
{
registerInfo
.
setRecord
(
record
);
registerInfo
.
setRecDate
(
new
Date
());
registerInfo
.
setRegisterState
(
"6045"
);
idxBizJgRegisterInfoServiceImpl
.
save
(
registerInfo
);
}
// 监督管理
IdxBizJgSupervisionInfo
supervisionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgSupervisionInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
supervisionInfo
))
{
supervisionInfo
.
setRecord
(
record
);
supervisionInfo
.
setRecDate
(
new
Date
());
idxBizJgSupervisionInfoService
.
save
(
supervisionInfo
);
}
// 其他信息
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
IdxBizJgOtherInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
otherInfo
))
{
otherInfo
.
setRecord
(
record
);
otherInfo
.
setClaimStatus
(
"已认领"
);
otherInfo
.
setRecDate
(
new
Date
());
idxBizJgOtherInfoService
.
save
(
otherInfo
);
}
// 起重机械 技术参数
if
(
isQZJX
)
{
EquipTechParamLifting
equipTechParamLifting
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamLifting
.
class
);
equipTechParamLifting
.
setRecord
(
record
);
equipTechParamLiftingMapper
.
insert
(
equipTechParamLifting
);
}
// 场内机动车辆 技术参数
if
(
isCNJDXL
)
{
EquipTechParamVehicle
equipTechParamVehicle
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamVehicle
.
class
);
equipTechParamVehicle
.
setRecord
(
record
);
equipTechParamVehicleMapper
.
insert
(
equipTechParamVehicle
);
}
// 锅炉 技术参数
if
(
isGL
)
{
EquipTechParamBoiler
equipTechParamBoiler
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamBoiler
.
class
);
equipTechParamBoiler
.
setRecord
(
record
);
equipTechParamBoilerMapper
.
insert
(
equipTechParamBoiler
);
}
// 压力容器 技术参数
if
(
isYLRQ
)
{
EquipTechParamVessel
equipTechParamVessel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamVessel
.
class
);
equipTechParamVessel
.
setRecord
(
record
);
equipTechParamVesselMapper
.
insert
(
equipTechParamVessel
);
}
// 压力管道 技术参数
if
(
isYLGD
)
{
EquipTechParamPipeline
equipTechParamPipeline
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamPipeline
.
class
);
equipTechParamPipeline
.
setRecord
(
record
);
equipTechParamPipelineMapper
.
insert
(
equipTechParamPipeline
);
}
// 大型游乐设施 技术参数
if
(
isDXYNSS
)
{
EquipTechParamRides
equipTechParamRides
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamRides
.
class
);
equipTechParamRides
.
setRecord
(
record
);
equipTechParamRidesMapper
.
insert
(
equipTechParamRides
);
}
// 客运索道 技术参数
if
(
isKYSD
)
{
EquipTechParamRopeway
equipTechParamRopeway
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
),
EquipTechParamRopeway
.
class
);
equipTechParamRopeway
.
setRecord
(
record
);
equipTechParamRopewayMapper
.
insert
(
equipTechParamRopeway
);
}
// 保存到es
saveEquInfoToEs
(
record
);
});
return
Boolean
.
TRUE
;
}
/**
* 保存设备数据至es
*
* @param record 设备唯一编码
*/
private
void
saveEquInfoToEs
(
String
record
)
{
Map
<
String
,
Object
>
map
=
categoryOtherInfoMapper
.
selectDataById
(
record
);
ESEquipmentCategoryDto
equipmentCategoryDto
=
JSON
.
parseObject
(
toJSONString
(
map
),
ESEquipmentCategoryDto
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
equipmentCategoryDto
))
{
long
time
=
Timestamp
.
valueOf
(
map
.
get
(
"REC_DATE"
).
toString
().
substring
(
0
,
19
)).
getTime
();
equipmentCategoryDto
.
setREC_DATE
(
time
);
esEquipmentCategory
.
save
(
equipmentCategoryDto
);
}
}
}
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