Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
021b254e
Commit
021b254e
authored
May 29, 2020
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
58ae0fba
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
6 deletions
+79
-6
ExcelController.java
...yeejoin/amos/fas/business/controller/ExcelController.java
+4
-1
FireEquimtPointController.java
...os/fas/business/controller/FireEquimtPointController.java
+15
-1
FireEquipmentPointParam.java
...join/amos/fas/business/param/FireEquipmentPointParam.java
+47
-0
ExcelServiceImpl.java
...join/amos/fas/business/service/impl/ExcelServiceImpl.java
+6
-1
IExcelService.java
...eejoin/amos/fas/business/service/intfc/IExcelService.java
+1
-1
dbTemplate_fire_equippoint.xml
...c/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
+6
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ExcelController.java
View file @
021b254e
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentPointParam;
import
com.yeejoin.amos.fas.business.param.WaterResourceParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.util.FileHelper
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -57,7 +58,9 @@ public class ExcelController extends BaseController {
if
(
fileName
.
endsWith
(
".xls"
)
||
fileName
.
endsWith
(
".xlsx"
))
{
try
{
List
<
FireEquipmentPointParam
>
list
=
FileHelper
.
importExcel
(
file
,
1
,
1
,
FireEquipmentPointParam
.
class
);
iExcelService
.
importFireEquipmentPoint
(
list
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
getOrgCode
(
reginParams
);
iExcelService
.
importFireEquipmentPoint
(
list
,
orgCode
,
getUserId
());
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"导入装备监测点数据"
,
e
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireEquimtPointController.java
View file @
021b254e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
...
...
@@ -38,7 +39,8 @@ public class FireEquimtPointController extends BaseController {
@Autowired
private
IFireEquipPontService
fireEquipPontService
;
@Autowired
private
FireEquipPointMapper
fireEquipPointMapper
;
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加风险点"
,
notes
=
"添加风险点"
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -55,6 +57,14 @@ public class FireEquimtPointController extends BaseController {
fireEquipmentPoint
.
setOrgCode
(
compCode
);
fireEquipmentPoint
.
setCreateBy
(
getUserId
());
fireEquipmentPoint
.
setCreateDate
(
new
Date
());
//根据编号查询监测点
FireEquipmentPointEntity
pointEntity
=
fireEquipPointMapper
.
getByCode
(
fireEquipmentPoint
.
getCode
());
if
(
pointEntity
!=
null
)
{
return
CommonResponseUtil
.
failure
(
"监测点编号已经存在"
);
}
return
CommonResponseUtil
.
success
(
fireEquipPontService
.
savePoint
(
fireEquipmentPoint
));
}
...
...
@@ -143,6 +153,10 @@ public class FireEquimtPointController extends BaseController {
if
(
fireEquipmentPointEntity
.
getFireEquipmentId
()
==
null
)
{
fireEquipmentPointEntity
.
setFireEquipmentId
(
0L
);
}
return
fireEquipPontService
.
save
(
fireEquipmentPointEntity
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/param/FireEquipmentPointParam.java
View file @
021b254e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
param
;
import
java.util.Date
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
public
class
FireEquipmentPointParam
{
...
...
@@ -32,6 +34,51 @@ public class FireEquipmentPointParam {
@Excel
(
name
=
"告警类型"
,
replace
=
{
"火灾告警_1"
,
"电源开关_2"
,
"换流变_6"
,
"液位_3"
,
"流量_4"
,
"容量_5"
,
"故障告警_7"
},
orderNum
=
"8"
)
private
Long
alarmType
;
//增加所属公司orgcode
private
String
orgCode
;
private
String
createBy
;
private
Date
createDate
=
new
Date
();
private
String
remark
;
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getOrgCode
()
{
return
orgCode
;
}
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
Long
getId
()
{
return
id
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ExcelServiceImpl.java
View file @
021b254e
...
...
@@ -71,7 +71,7 @@ public class ExcelServiceImpl implements IExcelService {
@Transactional
@Override
public
void
importFireEquipmentPoint
(
List
<
FireEquipmentPointParam
>
list
)
{
public
void
importFireEquipmentPoint
(
List
<
FireEquipmentPointParam
>
list
,
String
orgCode
,
String
userid
)
{
Set
<
String
>
equipmentCodeSet
=
Sets
.
newHashSet
(
Lists
.
transform
(
list
,
FireEquipmentPointParam:
:
getFireEquipmentCode
));
List
<
FireEquipmentEntity
>
equipments
=
fireEquipMapper
.
listByCodes
(
equipmentCodeSet
);
Map
<
String
,
FireEquipmentEntity
>
equipmentMap
=
Maps
.
uniqueIndex
(
equipments
,
FireEquipmentEntity:
:
getCode
);
...
...
@@ -90,6 +90,11 @@ public class ExcelServiceImpl implements IExcelService {
}
else
{
point
.
setFireEquipmentId
(
0L
);
}
//设置orgcode
point
.
setOrgCode
(
orgCode
);
point
.
setCreateBy
(
userid
);
if
(
pointEntity
==
null
)
{
saveList
.
add
(
point
);
}
else
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IExcelService.java
View file @
021b254e
...
...
@@ -11,7 +11,7 @@ public interface IExcelService {
void
importFireEquipment
(
List
<
FireEquipmentParam
>
list
);
void
importFireEquipmentPoint
(
List
<
FireEquipmentPointParam
>
list
);
void
importFireEquipmentPoint
(
List
<
FireEquipmentPointParam
>
list
,
String
orgcode
,
String
uid
);
List
<?>
exportPointData
(
Map
<
String
,
Object
>
paramsMap
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
View file @
021b254e
...
...
@@ -103,7 +103,9 @@
fire_equipment_id,
type,
unit,
alarm_type
alarm_type,
org_code,
create_by
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
...
...
@@ -113,7 +115,9 @@
#{item.fireEquipmentId},
#{item.type},
#{item.unit},
#{item.alarmType}
#{item.alarmType},
#{item.orgCode},
#{item.createBy}
)
</foreach>
</insert>
...
...
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