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
37d48d35
Commit
37d48d35
authored
Sep 12, 2023
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口适配
parent
809e8e21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
12 deletions
+60
-12
EquipmentController.java
...oin/amos/fas/business/controller/EquipmentController.java
+21
-7
FireSourceController.java
...in/amos/fas/business/controller/FireSourceController.java
+39
-5
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentController.java
View file @
37d48d35
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.fas.business.util.ExcelUtils
;
import
com.yeejoin.amos.fas.business.util.ExcelUtils
;
import
com.yeejoin.amos.fas.core.util.*
;
import
com.yeejoin.amos.fas.core.util.*
;
...
@@ -48,7 +47,7 @@ public class EquipmentController extends BaseController {
...
@@ -48,7 +47,7 @@ public class EquipmentController extends BaseController {
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
create
(
@RequestBody
Equipment
equipment
)
throws
Exception
{
public
CommonResponse
create
(
@RequestBody
Equipment
equipment
)
throws
Exception
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
String
compCode
=
getOrgCode
(
reginParams
);
equipment
.
setCreateBy
(
getUserId
());
equipment
.
setCreateBy
(
getUserId
());
...
@@ -78,7 +77,7 @@ public class EquipmentController extends BaseController {
...
@@ -78,7 +77,7 @@ public class EquipmentController extends BaseController {
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{ids}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
delete
(
@PathVariable
String
ids
)
throws
Exception
{
public
CommonResponse
delete
(
@PathVariable
String
ids
)
throws
Exception
{
String
[]
idArray
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
if
(
iEquipService
.
countFemaRelation
(
idArray
)
>
0
)
{
if
(
iEquipService
.
countFemaRelation
(
idArray
)
>
0
)
{
return
CommonResponseUtil
.
failure
(
"该重点设备已被FMEA绑定,请先删除绑定关系"
);
return
CommonResponseUtil
.
failure
(
"该重点设备已被FMEA绑定,请先删除绑定关系"
);
}
}
...
@@ -139,6 +138,21 @@ public class EquipmentController extends BaseController {
...
@@ -139,6 +138,21 @@ public class EquipmentController extends BaseController {
return
CommonResponseUtil
.
success
(
list
);
return
CommonResponseUtil
.
success
(
list
);
}
}
/**
* 保护对象查询查询,不分页
* @return
*/
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"保护对象查询不分页"
,
notes
=
"保护对象查询不分页"
)
@RequestMapping
(
value
=
"/all-list-for-studio"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
queryImpEquipNoPageForStudio
()
{
List
<
Equipment
>
list
=
iEquipService
.
queryEquipNoPage
();
List
<
Equipment
>
result
=
Objects
.
isNull
(
list
)
?
Collections
.
emptyList
()
:
list
;
return
CommonResponseUtil2
.
success
(
result
);
}
/**
/**
* 绑定消防设备
* 绑定消防设备
...
@@ -302,14 +316,14 @@ public class EquipmentController extends BaseController {
...
@@ -302,14 +316,14 @@ public class EquipmentController extends BaseController {
return
CommonResponseUtil
.
success
(
iEquipService
.
findAll
());
return
CommonResponseUtil
.
success
(
iEquipService
.
findAll
());
}
}
//
//
// @ApiOperation(httpMethod = "POST",value = "添加重点设备", notes = "添加重点设备")
// @ApiOperation(httpMethod = "POST",value = "添加重点设备", notes = "添加重点设备")
// @RequestMapping(value = "/point", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// @RequestMapping(value = "/point", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse point(@RequestBody List<EquipmentPlanPoint> point) throws Exception{
// public CommonResponse point(@RequestBody List<EquipmentPlanPoint> point) throws Exception{
// iEquipService.savePlanPoint(point);
// iEquipService.savePlanPoint(point);
// return CommonResponseUtil.success();
// return CommonResponseUtil.success();
// }
// }
//
//
// @ApiOperation(httpMethod = "DELETE",value = "删除重点设备", notes = "查询单个重点设备")
// @ApiOperation(httpMethod = "DELETE",value = "删除重点设备", notes = "查询单个重点设备")
// @RequestMapping(value = "/point/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// @RequestMapping(value = "/point/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse deletePoint(@PathVariable Long[] ids) throws Exception {
// public CommonResponse deletePoint(@PathVariable Long[] ids) throws Exception {
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireSourceController.java
View file @
37d48d35
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireCarService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireCarService
;
...
@@ -12,6 +13,8 @@ import com.yeejoin.amos.fas.core.common.request.CommonRequest;
...
@@ -12,6 +13,8 @@ import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -44,7 +48,7 @@ public class FireSourceController extends BaseController {
...
@@ -44,7 +48,7 @@ public class FireSourceController extends BaseController {
// @ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
// @ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse create(@RequestBody FireEquipment fireEquipment) throws Exception {
// public CommonResponse create(@RequestBody FireEquipment fireEquipment) throws Exception {
//
//
// if(fireEquipment.getId() == 0l) {//新增
// if(fireEquipment.getId() == 0l) {//新增
// Boolean existByCode = iFireEquipService.isExistByCode(fireEquipment.getCode());
// Boolean existByCode = iFireEquipService.isExistByCode(fireEquipment.getCode());
// if(existByCode){
// if(existByCode){
...
@@ -56,11 +60,11 @@ public class FireSourceController extends BaseController {
...
@@ -56,11 +60,11 @@ public class FireSourceController extends BaseController {
// fireEquipment.setCreateBy(getUserId());
// fireEquipment.setCreateBy(getUserId());
// fireEquipment.setCreateDate(new Date());
// fireEquipment.setCreateDate(new Date());
// fireEquipment.setOrgCode(compCode);
// fireEquipment.setOrgCode(compCode);
//
//
// //设备状态默认为正常
// //设备状态默认为正常
// fireEquipment.setEquipStatus(0);
// fireEquipment.setEquipStatus(0);
//
//
//
//
// return CommonResponseUtil.success(iFireEquipService.save(fireEquipment));
// return CommonResponseUtil.success(iFireEquipService.save(fireEquipment));
// }
// }
...
@@ -189,6 +193,36 @@ public class FireSourceController extends BaseController {
...
@@ -189,6 +193,36 @@ public class FireSourceController extends BaseController {
}
}
@Permission
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防设备历史数据"
,
notes
=
"查询消防设备历史数据"
)
@RequestMapping
(
value
=
"/data/history-for-studio"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
queryForFireEquipmentHistoryForStudio
(
@ApiParam
(
value
=
"设备名称"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
fireEquipmentName
,
@ApiParam
(
value
=
"按保护对象名称"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
equipmentName
,
@ApiParam
(
value
=
"开始日期"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
startTime
,
@ApiParam
(
value
=
"结束日期"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
endTime
,
int
pageNumber
,
int
pageSize
)
{
if
(
pageNumber
>=
1
)
{
--
pageNumber
;
}
Page
page
;
try
{
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
page
=
iFireEquipService
.
queryForFireEquipmentHistory
(
StringUtils
.
trimToNull
(
fireEquipmentName
),
StringUtils
.
trimToNull
(
equipmentName
),
StringUtils
.
trimToNull
(
startTime
),
StringUtils
.
trimToNull
(
endTime
),
commonPageable
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil2
.
failure
(
e
.
getMessage
());
}
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
Object
>
objectPage
=
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<>();
objectPage
.
setCurrent
(
page
.
getNumber
());
objectPage
.
setRecords
(
page
.
getContent
());
objectPage
.
setTotal
(
page
.
getTotalElements
());
objectPage
.
setPages
(
page
.
getTotalPages
());
return
CommonResponseUtil2
.
success
(
objectPage
);
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防设备列表"
,
notes
=
"查询消防设备列表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防设备列表"
,
notes
=
"查询消防设备列表"
)
@RequestMapping
(
value
=
"/info/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/info/page"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForEquipmentList
(
public
CommonResponse
queryForEquipmentList
(
...
@@ -215,6 +249,6 @@ public class FireSourceController extends BaseController {
...
@@ -215,6 +249,6 @@ public class FireSourceController extends BaseController {
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"消防装备明细查询失败"
+
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"消防装备明细查询失败"
+
e
.
getMessage
());
}
}
}
}
}
}
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