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
fe6ce699
Commit
fe6ce699
authored
Jul 04, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
b6a346f4
f8c94a36
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
173 additions
and
1 deletion
+173
-1
DataDockTemplateVersionUtils.java
...ot/module/jg/api/common/DataDockTemplateVersionUtils.java
+141
-0
EquipInfoExcelDto.java
...eejoin/amos/boot/module/jg/api/dto/EquipInfoExcelDto.java
+10
-0
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+13
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+7
-0
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+2
-1
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/common/DataDockTemplateVersionUtils.java
0 → 100644
View file @
fe6ce699
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
common
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelReader
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.excel.read.metadata.ReadSheet
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipInfoExcelDto
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 批量版本控制
* <p>
* 每个下载模板新建名为“版本信息”的隐藏sheet, sheet内维护模板的版本信息, 每次上传前与模板的版本进行对比,不一致则返回错误信息
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jg.api.common
*
* @author yangyang
* @version v1.0
* @date 2025/7/4 13:44
*/
@UtilityClass
public
class
DataDockTemplateVersionUtils
{
/**
* 错误提示
*/
public
static
final
String
ERROR_MESSAGE
=
"数据上传模板有更新了,请您下载最新的梳理数据上传!"
;
public
static
final
Map
<
String
,
String
>
VERSION_MAP
=
new
HashMap
<>();
static
{
VERSION_MAP
.
put
(
"工业管道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"公用管道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证_压力容器设备_氧舱"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_场内机动车辆"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_电梯设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_管道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_锅炉设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_起重机械设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_索道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_压力容器设备_固定式"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_压力容器设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史无证设备_游乐设施设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_场内机动车辆"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_电梯设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_管道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_锅炉设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_起重机械设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_索道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_压力容器设备_固定式"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_压力容器设备_氧舱"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_压力容器设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"历史有证_游乐设施设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_场内机动车辆"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_电梯设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_管道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_锅炉设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_起重机械设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_索道设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_压力容器设备_固定式"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_压力容器设备_氧舱"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"新设备_游乐设施设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"压力容器设备"
,
"V1.0.0"
);
VERSION_MAP
.
put
(
"长输管道设备"
,
"V1.0.0"
);
}
/**
* 比较版本号是否一致
*
* @param key key
* @param version version
* @return {@link boolean}
* @author yangyang
* @date 2025/7/4 15:17
*/
public
static
boolean
isSameVersion
(
String
key
,
String
version
)
{
if
(
ValidationUtil
.
isEmpty
(
key
)
||
ValidationUtil
.
isEmpty
(
version
))
{
return
false
;
}
if
(!
VERSION_MAP
.
containsKey
(
key
))
{
return
false
;
}
return
version
.
equals
(
VERSION_MAP
.
get
(
key
));
}
/**
* 校验上传的文件是否使用正确版本的模板
*
*
* @param file file
* @author yangyang
* @date 2025/7/4 15:19
*/
public
static
String
checkTemplateVersion
(
MultipartFile
file
)
throws
IOException
{
byte
[]
fileBytes
=
file
.
getBytes
();
ExcelReader
excelReader
=
EasyExcel
.
read
(
new
ByteArrayInputStream
(
fileBytes
)).
build
();
List
<
ReadSheet
>
sheetList
=
excelReader
.
excelExecutor
().
sheetList
();
// 获取所有 sheet
return
checkTemplateVersion
(
file
,
sheetList
);
}
public
static
String
checkTemplateVersion
(
MultipartFile
file
,
List
<
ReadSheet
>
sheetList
)
throws
IOException
{
byte
[]
fileBytes
=
file
.
getBytes
();
List
<
String
>
errorMessages
=
new
ArrayList
<>(
1
);
for
(
ReadSheet
readSheet
:
sheetList
)
{
String
sheetName
=
readSheet
.
getSheetName
();
if
(!
sheetName
.
contains
(
"版本信息"
))
{
continue
;
}
int
sheetNo
=
readSheet
.
getSheetNo
();
EasyExcel
.
read
(
new
ByteArrayInputStream
(
fileBytes
),
EquipInfoExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoExcelDto
>()
{
@Override
public
void
invoke
(
EquipInfoExcelDto
data
,
AnalysisContext
context
)
{
if
(!
DataDockTemplateVersionUtils
.
isSameVersion
(
data
.
getTemplateKey
(),
data
.
getTemplateVersion
()))
{
errorMessages
.
add
(
DataDockTemplateVersionUtils
.
ERROR_MESSAGE
);
}
}
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
}
}).
headRowNumber
(
1
).
sheet
(
sheetNo
,
sheetName
).
doRead
();
}
return
ValidationUtil
.
isEmpty
(
errorMessages
)
?
""
:
errorMessages
.
get
(
0
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/EquipInfoExcelDto.java
View file @
fe6ce699
...
@@ -1124,4 +1124,13 @@ public class EquipInfoExcelDto extends BaseDto {
...
@@ -1124,4 +1124,13 @@ public class EquipInfoExcelDto extends BaseDto {
@ApiModelProperty
(
value
=
"管道级别"
)
@ApiModelProperty
(
value
=
"管道级别"
)
@ExcelIgnore
@ExcelIgnore
private
String
deviceLevel_GD
;
private
String
deviceLevel_GD
;
//--------------------------------------------------------------版本信息
@ExcelProperty
(
value
=
"模板Key"
)
@ApiModelProperty
(
value
=
"模板Key"
)
private
String
templateKey
;
@ExcelProperty
(
value
=
"版本号"
)
@ApiModelProperty
(
value
=
"版本号"
)
private
String
templateVersion
;
}
}
\ 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/service/impl/DataDockServiceImpl.java
View file @
fe6ce699
...
@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.ExcelImportErrorLogDao;
...
@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.ExcelImportErrorLogDao;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelImportErrorLogDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelImportErrorLogDto
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.jg.api.common.DataDockTemplateVersionUtils
;
import
com.yeejoin.amos.boot.module.jg.api.converter.DictParamsConverter
;
import
com.yeejoin.amos.boot.module.jg.api.converter.DictParamsConverter
;
import
com.yeejoin.amos.boot.module.jg.api.converter.EquCategoryConverter
;
import
com.yeejoin.amos.boot.module.jg.api.converter.EquCategoryConverter
;
import
com.yeejoin.amos.boot.module.jg.api.converter.EquDefineConverter
;
import
com.yeejoin.amos.boot.module.jg.api.converter.EquDefineConverter
;
...
@@ -781,6 +782,11 @@ public class DataDockServiceImpl {
...
@@ -781,6 +782,11 @@ public class DataDockServiceImpl {
InputStream
inputStream
=
file
.
getInputStream
();
InputStream
inputStream
=
file
.
getInputStream
();
ExcelReader
excelReader
=
EasyExcel
.
read
(
inputStream
).
build
();
ExcelReader
excelReader
=
EasyExcel
.
read
(
inputStream
).
build
();
List
<
ReadSheet
>
sheetList
=
excelReader
.
excelExecutor
().
sheetList
();
// 获取所有 sheet
List
<
ReadSheet
>
sheetList
=
excelReader
.
excelExecutor
().
sheetList
();
// 获取所有 sheet
// 判断模板版本号
String
templateVersionError
=
DataDockTemplateVersionUtils
.
checkTemplateVersion
(
file
,
sheetList
);
if
(!
ValidationUtil
.
isEmpty
(
templateVersionError
))
{
throw
new
BadRequest
(
templateVersionError
);
}
for
(
ReadSheet
readSheet
:
sheetList
)
{
for
(
ReadSheet
readSheet
:
sheetList
)
{
String
sheetName
=
readSheet
.
getSheetName
();
String
sheetName
=
readSheet
.
getSheetName
();
...
@@ -1581,6 +1587,12 @@ public class DataDockServiceImpl {
...
@@ -1581,6 +1587,12 @@ public class DataDockServiceImpl {
List
<
String
>
resultGDError
=
new
ArrayList
<>();
List
<
String
>
resultGDError
=
new
ArrayList
<>();
List
<
String
>
pipelineNumList
=
new
ArrayList
<>();
List
<
String
>
pipelineNumList
=
new
ArrayList
<>();
try
{
try
{
// 判断模板版本号
String
templateVersionError
=
DataDockTemplateVersionUtils
.
checkTemplateVersion
(
multipartFile
);
if
(!
ValidationUtil
.
isEmpty
(
templateVersionError
))
{
resultGDError
.
add
(
templateVersionError
);
throw
new
BadRequest
(
templateVersionError
);
}
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
PipingExcelDto
.
class
,
new
AnalysisEventListener
<
PipingExcelDto
>()
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
PipingExcelDto
.
class
,
new
AnalysisEventListener
<
PipingExcelDto
>()
{
@Override
@Override
public
void
invoke
(
PipingExcelDto
data
,
AnalysisContext
context
)
{
public
void
invoke
(
PipingExcelDto
data
,
AnalysisContext
context
)
{
...
@@ -2893,4 +2905,5 @@ public class DataDockServiceImpl {
...
@@ -2893,4 +2905,5 @@ public class DataDockServiceImpl {
equ
.
put
(
"inspectConclusion"
,
inspectionDetectionInfo
.
getInspectConclusion
());
equ
.
put
(
"inspectConclusion"
,
inspectionDetectionInfo
.
getInspectConclusion
());
}
}
}
}
}
}
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 @
fe6ce699
...
@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
...
@@ -28,6 +28,7 @@ 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.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.EquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.EquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.jg.api.common.DataDockTemplateVersionUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
...
@@ -3923,6 +3924,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3923,6 +3924,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
equCodeList
.
clear
();
equCodeList
.
clear
();
factoryNumList
.
clear
();
factoryNumList
.
clear
();
try
{
try
{
// 判断模板版本号
String
templateVersionError
=
DataDockTemplateVersionUtils
.
checkTemplateVersion
(
multipartFile
);
if
(!
ValidationUtil
.
isEmpty
(
templateVersionError
))
{
resultError
.
add
(
templateVersionError
);
throw
new
BadRequest
(
templateVersionError
);
}
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
// 每读取一行就调用该方法
// 每读取一行就调用该方法
@Override
@Override
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
fe6ce699
...
@@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils;
...
@@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -1957,7 +1958,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1957,7 +1958,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryTechParam
(
String
type
)
{
public
JSONArray
queryTechParam
(
String
type
)
{
if
(
ValidationUtil
.
isEmpty
(
type
))
{
if
(
ValidationUtil
.
isEmpty
(
type
))
{
throw
new
Ba
dRequest
(
"需要先选择设备品种,才能选择技术参数"
);
throw
new
Ba
seException
(
"需要先选择设备品种,才能选择技术参数"
,
"200"
,
"需要先选择设备品种,才能选择技术参数"
);
}
}
List
<
TechParamItem
>
paramMetaList
=
TechParamUtil
.
getParamMetaList
(
type
);
List
<
TechParamItem
>
paramMetaList
=
TechParamUtil
.
getParamMetaList
(
type
);
JSONArray
list
=
new
JSONArray
();
JSONArray
list
=
new
JSONArray
();
...
...
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