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
fa720d7c
Commit
fa720d7c
authored
Dec 07, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消防装备
parent
2abbe8f1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
142 additions
and
16 deletions
+142
-16
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+15
-2
EquipDataDto.java
...c/main/java/com/yeejoin/equipmanage/dto/EquipDataDto.java
+80
-0
EquipmentDetailDownloadTemplateDto.java
...n/equipmanage/dto/EquipmentDetailDownloadTemplateDto.java
+4
-4
EquipmentDetailExcelSingleTemplateDto.java
...quipmanage/dto/EquipmentDetailExcelSingleTemplateDto.java
+14
-9
ExcelServiceImpl.java
...om/yeejoin/equipmanage/service/impl/ExcelServiceImpl.java
+28
-0
application.properties
...ot-system-equip/src/main/resources/application.properties
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
fa720d7c
...
...
@@ -110,6 +110,8 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
private
RedisUtils
redisUtils
;
@Value
(
"${equip.enabled}"
)
private
Boolean
enabled
;
@Value
(
"${iot.code.prefix.have.used:20210003,20210004,20210005}"
)
...
...
@@ -549,7 +551,13 @@ public class EquipmentDetailController extends AbstractBaseController {
// }
//
// } catch (Exception e) {
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZBSINGLE
.
getType
());
ExcelEnums
excelEnums
=
null
;
if
(!
enabled
){
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZBSINGLE
.
getType
());
}
else
{
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZB
.
getType
());
}
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
...
...
@@ -590,7 +598,12 @@ public class EquipmentDetailController extends AbstractBaseController {
try
{
UUID
uuid
=
UUID
.
randomUUID
();
key
=
uuid
.
toString
();
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelEnums
excelEnums
=
null
;
if
(!
enabled
){
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZBSINGLE
.
getType
());
}
else
{
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZB
.
getType
());
}
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
// date= excelService.commonUpload(file, excelDto, getSelectedOrgInfo(), getUserInfo());
EquipmentDetailController
controllerProxy1
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/EquipDataDto.java
0 → 100644
View file @
fa720d7c
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yeejoin.equipmanage.utils.ExplicitConstraint
;
import
com.yeejoin.equipmanage.utils.RoleNameExplicitConstraint
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
EquipDataDto
{
@Excel
(
name
=
"器材名称"
,
width
=
30
,
orderNum
=
"1"
)
private
String
name
;
@Excel
(
name
=
"器材编码(从装备定义中获取)"
,
width
=
30
,
orderNum
=
"2"
)
private
String
code
;
@Excel
(
name
=
"规格型号"
,
width
=
30
,
orderNum
=
"3"
)
private
String
standard
;
@Excel
(
name
=
"品牌"
,
width
=
30
,
orderNum
=
"4"
)
private
String
brand
;
@Excel
(
name
=
"生产厂家名称"
,
width
=
30
,
orderNum
=
"5"
)
private
String
manufacturerName
;
@Excel
(
name
=
"设备编码"
,
width
=
30
,
orderNum
=
"6"
)
private
String
systemCode
;
@Excel
(
name
=
"物联编码"
,
width
=
30
,
orderNum
=
"7"
)
private
String
iotCode
;
@Excel
(
name
=
"存放位置(货位编码)"
,
width
=
30
,
orderNum
=
"8"
)
private
String
warehouseStructCode
;
@Excel
(
name
=
"位置信息"
,
width
=
30
,
orderNum
=
"9"
)
private
String
description
;
@Excel
(
name
=
"消防系统编码"
,
width
=
30
,
orderNum
=
"10"
)
private
String
fightingSysCodes
;
//动态下拉内容
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"11"
)
private
String
companyName
;
// @ExcelProperty(value = "报废年限", index = 13)
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private String expiryDate;
//
// @ExcelProperty(value = "维保周期", index = 14)
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@Excel
(
name
=
"生产日期"
,
width
=
30
,
orderNum
=
"12"
)
private
Date
productionDate
;
@ExcelProperty
(
value
=
"投运日期"
,
index
=
13
)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private
Date
deliveryDate
;
//动态下拉内容
// @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
// @ExcelProperty(value = "所属系统", index = 16)
// //@Excel(name = "所属单位",width = 30,orderNum = "12")
// private String systemName;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/EquipmentDetailDownloadTemplateDto.java
View file @
fa720d7c
...
...
@@ -49,13 +49,13 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
@Excel
(
name
=
"消防系统编码"
,
width
=
30
,
orderNum
=
"10"
)
private
String
fightingSysCodes
;
@Excel
(
name
=
"所属队伍"
,
width
=
30
,
orderNum
=
"1
1
"
)
@Excel
(
name
=
"所属队伍"
,
width
=
30
,
orderNum
=
"1
4
"
)
private
String
fireTeam
;
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"1
2
"
)
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"1
1
"
)
private
String
companyName
;
@Excel
(
name
=
"生产日期"
,
width
=
30
,
orderNum
=
"1
3
"
)
@Excel
(
name
=
"生产日期"
,
width
=
30
,
orderNum
=
"1
2
"
)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private
Date
productionDate
;
...
...
@@ -67,7 +67,7 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@Excel
(
name
=
"投运时间"
,
width
=
30
,
orderNum
=
"1
4
"
)
@Excel
(
name
=
"投运时间"
,
width
=
30
,
orderNum
=
"1
3
"
)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private
Date
deliveryDate
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/EquipmentDetailExcelSingleTemplateDto.java
View file @
fa720d7c
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yeejoin.equipmanage.utils.ExplicitConstraint
;
import
com.yeejoin.equipmanage.utils.RoleNameExplicitConstraint
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -52,19 +55,14 @@ public class EquipmentDetailExcelSingleTemplateDto {
@ExcelProperty
(
value
=
"消防系统编码"
,
index
=
9
)
//@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private
String
fightingSysCodes
;
@ExplicitConstraint
(
indexNum
=
10
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getEquipFireTeam"
)
//动态下拉内容
@ExcelProperty
(
value
=
"所属队伍"
,
index
=
10
)
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private
String
fireTeam
;
//动态下拉内容
@ExplicitConstraint
(
indexNum
=
1
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getEquipCompany"
)
//动态下拉内容
@ExcelProperty
(
value
=
"所属单位"
,
index
=
1
1
)
@ExplicitConstraint
(
indexNum
=
1
0
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getEquipCompany"
)
//动态下拉内容
@ExcelProperty
(
value
=
"所属单位"
,
index
=
1
0
)
//@Excel(name = "所属单位",width = 30,orderNum = "12")
private
String
companyName
;
@ExcelProperty
(
value
=
"生产日期"
,
index
=
1
2
)
@ExcelProperty
(
value
=
"生产日期"
,
index
=
1
1
)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private
Date
productionDate
;
...
...
@@ -76,10 +74,17 @@ public class EquipmentDetailExcelSingleTemplateDto {
// //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ;
@ExcelProperty
(
value
=
"投运日期"
,
index
=
1
3
)
@ExcelProperty
(
value
=
"投运日期"
,
index
=
1
2
)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private
Date
deliveryDate
;
//@ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getEquipFireTeam") //动态下拉内容
//@ExcelProperty(value = "所属队伍", index = 13)
@ExcelIgnore
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private
String
fireTeam
;
//动态下拉内容
// @ExplicitConstraint(indexNum = 16, sourceClass = RoleNameExplicitConstraint.class,method="getFireSystemList") //动态下拉内容
// @ExcelProperty(value = "所属系统", index = 16)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ExcelServiceImpl.java
View file @
fa720d7c
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.equipmanage.dto.EquipDataDto
;
import
com.yeejoin.equipmanage.dto.EquipmentDetailExcelSingleTemplateDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
...
...
@@ -59,6 +63,13 @@ public class ExcelServiceImpl implements IExcelService {
throw
new
BadRequest
(
e
.
getMessage
());
}
break
;
case
"XFZBSINGLE"
:
try
{
date
=
excelImportFireEquipmentDl
(
multipartFile
,
reginParams
,
agencyUserModel
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
e
.
getMessage
());
}
break
;
case
"JKXX"
:
try
{
excelImporVideo
(
multipartFile
);
...
...
@@ -85,6 +96,23 @@ public class ExcelServiceImpl implements IExcelService {
return
date
;
}
private
Object
excelImportFireEquipmentDl
(
MultipartFile
multipartFile
,
ReginParams
reginParams
,
AgencyUserModel
agencyUserModel
)
throws
Exception
{
Object
date
=
""
;
List
<
EquipDataDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
EquipDataDto
.
class
,
1
);
List
<
EquipmentDetailDownloadTemplateDto
>
objects
=
new
ArrayList
<>();
String
s
=
JSONObject
.
toJSONString
(
excelDtoList
);
List
<
EquipmentDetailDownloadTemplateDto
>
dtos
=
JSONObject
.
parseArray
(
s
,
EquipmentDetailDownloadTemplateDto
.
class
);
if
(
excelDtoList
!=
null
&&
excelDtoList
.
size
()
>
0
)
{
date
=
iStockService
.
uploadListByTemplate
(
dtos
,
reginParams
,
agencyUserModel
);
}
else
{
throw
new
BadRequest
(
"请填写数据后再上传!"
);
}
return
date
;
}
private
void
excelImporVideo
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
VideoDownloadVO
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
...
...
amos-boot-system-equip/src/main/resources/application.properties
View file @
fa720d7c
...
...
@@ -87,7 +87,7 @@ dcs.client.secret=fire_system
dcs.x.hw.id
=
NR_REST_APP
dcs.x.hw.appKey
=
s+YkvQhwilx91TRJHhNDmw==
# 故障告警/消防告警/跑马灯权限标识 true 机场 / false 电力
equip.enabled
=
tru
e
equip.enabled
=
fals
e
management.endpoints.enabled-by-default
=
false
...
...
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