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
67924c9d
Commit
67924c9d
authored
Aug 15, 2022
by
Tkunkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改装备 CRUD
增加了故障知识库 CRUD 增加了故障记录
parent
14690663
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
422 additions
and
58 deletions
+422
-58
EquipmentDetail.java
...om/yeejoin/equipmanage/common/entity/EquipmentDetail.java
+5
-3
EquipmentFaultKnowledge.java
...in/equipmanage/common/entity/EquipmentFaultKnowledge.java
+35
-0
EquipmentParams.java
...om/yeejoin/equipmanage/common/entity/EquipmentParams.java
+20
-7
DetailssAmountVO.java
...eejoin/equipmanage/common/entity/vo/DetailssAmountVO.java
+6
-0
EquipmentFaultKnowledgeVO.java
...uipmanage/common/entity/vo/EquipmentFaultKnowledgeVO.java
+29
-0
EquipmentDate.java
...java/com/yeejoin/equipmanage/common/vo/EquipmentDate.java
+2
-2
pom.xml
...le/amos-boot-module-biz/amos-boot-module-demo-biz/pom.xml
+6
-7
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+84
-12
EquipmentFaultKnowledgeController.java
...pmanage/controller/EquipmentFaultKnowledgeController.java
+137
-0
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+1
-0
EquipmentFaultKnowledgeMapper.java
...oin/equipmanage/mapper/EquipmentFaultKnowledgeMapper.java
+15
-0
IEquipmentFaultKnowledgeService.java
.../equipmanage/service/IEquipmentFaultKnowledgeService.java
+17
-0
EquipmentFaultKnowledgeServiceImpl.java
...nage/service/impl/EquipmentFaultKnowledgeServiceImpl.java
+16
-0
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+3
-3
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+22
-0
EquipmentDetailMapper.xml
...equip/src/main/resources/mapper/EquipmentDetailMapper.xml
+10
-10
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+14
-14
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentDetail.java
View file @
67924c9d
...
...
@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
...
...
@@ -74,9 +75,6 @@ public class EquipmentDetail extends BaseEntity {
private
ManufacturerInfo
manufacturerInfo
;
@TableField
(
"update_date"
)
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
...
...
@@ -118,6 +116,10 @@ public class EquipmentDetail extends BaseEntity {
@TableField
(
"supplier_id"
)
@ApiModelProperty
(
value
=
"供应商id"
)
private
String
supplierId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"设备的状态"
)
private
String
status
;
@TableField
(
exist
=
false
)
private
List
<
UploadFile
>
img
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentFaultKnowledge.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* @Auther tjk
* @Date 2022 08 03
**/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"wl_equipment_fault_knowledge"
)
@ApiModel
(
value
=
"FaultKnowledge"
,
description
=
"设备故障知识库"
)
public
class
EquipmentFaultKnowledge
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
//故障的类型
@TableField
(
"type"
)
private
String
type
;
//采取的措施
@TableField
(
"measure"
)
private
String
measure
;
//备用字段
@TableField
(
"spare"
)
private
String
spare
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentParams.java
View file @
67924c9d
...
...
@@ -15,6 +15,10 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* 故障类型
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
...
...
@@ -29,18 +33,27 @@ public class EquipmentParams extends BaseEntity {
@Excel
(
name
=
"状态"
,
orderNum
=
"11"
)
private
int
status
;
@TableField
(
"reason"
)
@ApiModelProperty
(
value
=
"原因分析"
)
@Excel
(
name
=
"原因分析"
,
orderNum
=
"12"
)
private
String
reason
;
@TableField
(
"detail_id"
)
@ApiModelProperty
(
value
=
"装备id"
)
private
Long
detailId
;
@TableField
(
"measure"
)
@TableField
(
"fault_knowledge_id"
)
@ApiModelProperty
(
value
=
"知识库id"
)
private
Long
faultKnowledgeId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"故障类型"
)
@Excel
(
name
=
"故障类型"
,
orderNum
=
"12"
)
private
String
type
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"处置措施"
)
@Excel
(
name
=
"处置措施"
,
orderNum
=
"13"
)
private
String
measure
;
@TableField
(
"code"
)
/* @TableField("code")
@ApiModelProperty(value = "设备编码")
private
String
code
;
private String code;
*/
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/DetailssAmountVO.java
View file @
67924c9d
...
...
@@ -8,12 +8,17 @@ package com.yeejoin.equipmanage.common.entity.vo;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 装备编辑界面的model
*/
@ApiModel
(
description
=
"设备数据封装VO"
)
@Data
public
class
DetailssAmountVO
{
...
...
@@ -90,4 +95,5 @@ public class DetailssAmountVO {
@ApiModelProperty
(
value
=
"装备定义名称"
)
private
String
equipmentName
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipmentFaultKnowledgeVO.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
/**
* @Auther tjk
* @Date 2022 08 03
**/
@Data
public
class
EquipmentFaultKnowledgeVO
{
/*
故障的类型
*/
private
String
type
;
/*
采取的措施
*/
private
String
measure
;
/*
备用字段
*/
private
String
spare
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/EquipmentDate.java
View file @
67924c9d
...
...
@@ -18,7 +18,7 @@ public class EquipmentDate {
private
EquipmentSpecific
equipmentSpecific
;
@ExcelEntity
private
EquipmentDetail
equipmentDetail
;
@ExcelEntity
private
EquipmentParams
equipmentParams
;
/*
@ExcelEntity
private EquipmentParams equipmentParams;
*/
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-demo-biz/pom.xml
View file @
67924c9d
...
...
@@ -13,15 +13,15 @@
<dependencies>
<dependency
>
<groupId>
com.amosframework.boot
</groupId
>
<artifactId>
amos-boot-module-demo-api
</artifactId
>
<version>
${amos-biz-boot.version}
</version
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>com.amosframework.boot</groupId>--
>
<!-- <artifactId>amos-boot-module-demo-api</artifactId>--
>
<!-- <version>${amos-biz-boot.version}</version>--
>
<!-- </dependency>--
>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -95,6 +96,9 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Autowired
private
IEquipmentFaultKnowledgeService
equipmentFaultKnowledgeService
;
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
...
...
@@ -111,6 +115,7 @@ public class EquipmentDetailController extends AbstractBaseController {
return
iEquipmentDetailService
.
saveOne
(
equipmentDetail
);
}
/**
* 设备新增带打码入库
***/
...
...
@@ -138,8 +143,8 @@ public class EquipmentDetailController extends AbstractBaseController {
}
}
EquipmentDate
date
=
equipmentSpecificSerivce
.
equipmentSpecificCreate
(
equipmentDate
,
getSelectedOrgInfo
(),
getUserInfo
());
equipmentDate
.
getEquipmentParams
().
setCode
(
equipmentDate
.
getEquipmentDetail
().
getEqcode
());
iEquipmentParamsService
.
saveOne
(
equipmentDate
.
getEquipmentParams
());
//
equipmentDate.getEquipmentParams().setCode(equipmentDate.getEquipmentDetail().getEqcode());
//
iEquipmentParamsService.saveOne(equipmentDate.getEquipmentParams());
// TODO 后续判断成功,执行同步
Long
equipmentId
=
date
.
getEquipmentDetail
().
getEquipmentId
();
// 编辑同步redis装备iotcode数据
...
...
@@ -183,10 +188,16 @@ public class EquipmentDetailController extends AbstractBaseController {
equipmentSpecific
.
setFullqrCode
(
"01#"
+
equipmentSpecific
.
getQrCode
());
EquipmentDetail
equipmentDetail
=
iEquipmentDetailService
.
getOneById
(
equipmentSpecific
.
getEquipmentDetailId
());
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"code"
,
equipmentDetail
.
getEqcode
());
EquipmentParams
equipmentParams
=
equipmentParamsMapper
.
selectByMap
(
map1
).
get
(
0
);
//查找装备故障的最后一条状态
QueryWrapper
<
EquipmentParams
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"detail_id"
,
equipmentDetail
.
getId
());
wrapper
.
orderByDesc
(
"create_date"
);
List
<
EquipmentParams
>
equipmentParams
=
equipmentParamsMapper
.
selectList
(
wrapper
);
if
(!
equipmentParams
.
isEmpty
()){
EquipmentParams
equipmentParam
=
equipmentParams
.
get
(
0
);
equipmentDetail
.
setStatus
(
Integer
.
toString
(
equipmentParam
.
getStatus
()));
}
equipmentDetail
.
setStatus
(
"正常"
);
StockDetail
stockDetail
=
null
;
if
(
stockDetailId
!=
null
){
...
...
@@ -205,7 +216,7 @@ public class EquipmentDetailController extends AbstractBaseController {
equipmentSpecific
.
setStock
(
iStockService
.
getById
(
stockDetail
.
getStockId
()));
}
equipmentDate
.
setEquipmentDetail
(
equipmentDetail
);
equipmentDate
.
setEquipmentParams
(
equipmentParams
);
//
equipmentDate.setEquipmentParams(equipmentParams);
equipmentDate
.
setEquipmentSpecific
(
equipmentSpecific
);
return
equipmentDate
;
}
...
...
@@ -240,12 +251,12 @@ public class EquipmentDetailController extends AbstractBaseController {
}
//1.更新装备实例Detail数据
EquipmentDetail
equipmentDetail
=
equipmentDate
.
getEquipmentDetail
();
EquipmentParams
equipmentParams
=
equipmentDate
.
getEquipmentParams
();
//
EquipmentParams equipmentParams = equipmentDate.getEquipmentParams();
final
EquipmentDetail
dateEquipmentDetail
=
equipmentDate
.
getEquipmentDetail
();
boolean
b
=
iEquipmentDetailService
.
updateOneById
(
equipmentDate
.
getEquipmentSpecific
().
getId
(),
dateEquipmentDetail
);
if
(
b
){
/*
if(b){
equipmentParamsService.updateById(equipmentDate.getEquipmentParams());
}
}
*/
//2.更新装备实例主表数据
Long
detailId
=
dateEquipmentDetail
.
getId
();
equipmentDate
.
getEquipmentSpecific
().
setEquipmentDetailId
(
detailId
);
...
...
@@ -601,11 +612,72 @@ public class EquipmentDetailController extends AbstractBaseController {
String
fileName
=
"装备清单"
+
new
Date
().
getTime
();
if
(
prop
==
1
){
//全部导出
List
<
DetailssAmountVO
>
getall
=
iEquipmentDetailService
.
getall
();
FileHelper
.
exportExcel
(
getall
,
"装备清单"
,
"装备清单"
,
DetailssAmountVO
.
class
,
fileName
+
".xls"
,
response
);
List
<
DetailssAmountVO
>
detailssAmountVOS
=
this
.
selectReasonMeasure
(
getall
);
FileHelper
.
exportExcel
(
detailssAmountVOS
,
"装备清单"
,
"装备清单"
,
DetailssAmountVO
.
class
,
fileName
+
".xls"
,
response
);
}
else
{
//仅仅导出筛选结果的数据
FileHelper
.
exportExcel
(
detailssAmountVO
,
"装备清单"
,
"装备清单"
,
DetailssAmountVO
.
class
,
fileName
+
".xls"
,
response
);
List
<
DetailssAmountVO
>
detailssAmountVOS
=
this
.
selectReasonMeasure
(
detailssAmountVO
);
FileHelper
.
exportExcel
(
detailssAmountVOS
,
"装备清单"
,
"装备清单"
,
DetailssAmountVO
.
class
,
fileName
+
".xls"
,
response
);
}
}
/**
* 查找原因分析和处置措施
*/
private
List
<
DetailssAmountVO
>
selectReasonMeasure
(
List
<
DetailssAmountVO
>
detailssAmountVO
){
for
(
DetailssAmountVO
model:
detailssAmountVO
){
Long
id
=
model
.
getId
();
Long
equipmentDetailId
=
equipmentSpecificSerivce
.
getById
(
id
).
getEquipmentDetailId
();
QueryWrapper
<
EquipmentParams
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"detail_id"
,
equipmentDetailId
);
wrapper
.
orderByDesc
(
"create_date"
);
List
<
EquipmentParams
>
equipmentParams
=
iEquipmentParamsService
.
list
(
wrapper
);
if
(!
equipmentParams
.
isEmpty
()){
EquipmentParams
equipmentParam
=
equipmentParams
.
get
(
0
);
model
.
setStatus
(
equipmentParam
.
getStatus
()==
0
?
"正常"
:
"故障"
);
Long
faultKnowledgeId
=
equipmentParam
.
getFaultKnowledgeId
();
EquipmentFaultKnowledge
equipmentFaultKnowledge
=
equipmentFaultKnowledgeService
.
getById
(
faultKnowledgeId
);
model
.
setReason
(
equipmentFaultKnowledge
.
getType
());
model
.
setMeasure
(
equipmentFaultKnowledge
.
getMeasure
());
}
else
{
model
.
setStatus
(
"正常"
);
}
}
return
detailssAmountVO
;
}
/**
* 根据equipCode查询故障记录
*
* @return
*/
@GetMapping
(
value
=
"/eqParamsList"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"按照id故障记录查询"
,
notes
=
"按照id故障记录查询"
)
public
IPage
<
EquipmentParams
>
list
(
@RequestParam
(
name
=
"cur"
)
String
pageNum
,
@RequestParam
(
name
=
"pageSize"
)
String
pageSize
,
@RequestParam
(
name
=
"specificId"
)
Long
specificId
)
{
Page
<
EquipmentParams
>
pageBean
;
IPage
<
EquipmentParams
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
EquipmentSpecific
equmentSpecific
=
equipmentSpecificSerivce
.
getById
(
specificId
);
Long
detailId
=
equmentSpecific
.
getEquipmentDetailId
();
QueryWrapper
<
EquipmentParams
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"detail_id"
,
detailId
);
wrapper
.
orderByDesc
(
"create_date"
);
page
=
iEquipmentParamsService
.
page
(
pageBean
,
wrapper
);
List
<
EquipmentParams
>
records
=
page
.
getRecords
();
for
(
EquipmentParams
ep
:
records
){
Long
faultKnowledgeId
=
ep
.
getFaultKnowledgeId
();
EquipmentFaultKnowledge
model
=
equipmentFaultKnowledgeService
.
getById
(
faultKnowledgeId
);
ep
.
setType
(
model
.
getType
());
ep
.
setMeasure
(
model
.
getMeasure
());
}
return
page
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentFaultKnowledgeController.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.EquipmentFaultKnowledge
;
import
com.yeejoin.equipmanage.service.IEquipmentFaultKnowledgeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
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
;
/**
* @Auther tjk
* @Date 2022 08 03
**/
@RestController
@Api
(
tags
=
"装备故障知识库API"
)
@RequestMapping
(
value
=
"/equip-konwledge"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
class
EquipmentFaultKnowledgeController
{
@Autowired
private
IEquipmentFaultKnowledgeService
iEquipmentFaultKnowledgeService
;
/**
* 知识库的新增
*/
/**
* 新增
*
* @return
*/
@PostMapping
(
value
=
"/save"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
Boolean
>
saveEquipmentDetail
(
@RequestBody
EquipmentFaultKnowledge
model
)
{
boolean
save
=
iEquipmentFaultKnowledgeService
.
save
(
model
);
return
ResponseHelper
.
buildResponse
(
save
);
}
/**
* 根据id删除
*
* @param ids
* @return
*/
@DeleteMapping
(
value
=
"/delete"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
@RequestParam
(
name
=
"id"
)
List
<
Long
>
ids
)
{
//删除之前需要看一下 装备故障表中 有无该故障,没有即可以删除,有则不能进行删除操作
boolean
b
=
false
;
for
(
Long
id:
ids
){
b
=
iEquipmentFaultKnowledgeService
.
removeById
(
id
);
if
(!
b
){
break
;
}
}
return
b
;
}
/**
* 列表分页查询
* @param pageNum
* @param pageSize
* @return
*/
@RequestMapping
(
value
=
"/listDate"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
EquipmentFaultKnowledge
>
listPage
(
@RequestParam
(
value
=
"current"
)
String
pageNum
,
@RequestParam
(
value
=
"size"
)
String
pageSize
)
{
Page
<
EquipmentFaultKnowledge
>
pageBean
;
IPage
<
EquipmentFaultKnowledge
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iEquipmentFaultKnowledgeService
.
page
(
pageBean
);
return
page
;
}
/**
* 根据id查找
*
* @param id
* @return
*/
@GetMapping
()
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"Get"
,
value
=
"根据id查找"
,
notes
=
"根据id查找"
)
public
ResponseModel
<
EquipmentFaultKnowledge
>
getById
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
EquipmentFaultKnowledge
model
=
iEquipmentFaultKnowledgeService
.
getById
(
id
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/***
*
* 修改
* **/
@PutMapping
(
value
=
"updateById"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
public
ResponseModel
<
Boolean
>
updateByIdEquipmentFaultKonwledge
(
@RequestBody
EquipmentFaultKnowledge
model
)
{
boolean
b
=
iEquipmentFaultKnowledgeService
.
updateById
(
model
);
return
ResponseHelper
.
buildResponse
(
b
);
}
/**
* 列表分页查询
* @return
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表查询"
,
notes
=
"列表查询"
)
public
ResponseModel
<
List
<
EquipmentFaultKnowledge
>>
listEquipmentFaultKonwledge
()
{
List
<
EquipmentFaultKnowledge
>
list
=
iEquipmentFaultKnowledgeService
.
list
();
return
ResponseHelper
.
buildResponse
(
list
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
67924c9d
...
...
@@ -291,6 +291,7 @@ public class FireFightingSystemController extends AbstractBaseController {
//
// }
@PostMapping
(
value
=
"/getEquipTypeAmount"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"九大类下装备,通过code截取"
,
notes
=
"九大类下装备信息列表"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentFaultKnowledgeMapper.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.equipmanage.common.entity.EquipmentFaultKnowledge
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* Mapper 接口
*
* @Auther tjk
* @Date 2022 08 03
**/
@Mapper
public
interface
EquipmentFaultKnowledgeMapper
extends
BaseMapper
<
EquipmentFaultKnowledge
>
{
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentFaultKnowledgeService.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
import
com.yeejoin.equipmanage.common.entity.EquipmentFaultKnowledge
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultKnowledgeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
/**
* @Auther tjk
* @Date 2022 08 03
**/
public
interface
IEquipmentFaultKnowledgeService
extends
IService
<
EquipmentFaultKnowledge
>
{
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentFaultKnowledgeServiceImpl.java
0 → 100644
View file @
67924c9d
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.EquipmentFaultKnowledge
;
import
com.yeejoin.equipmanage.mapper.EquipmentFaultKnowledgeMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentFaultKnowledgeService
;
import
org.springframework.stereotype.Service
;
/**
* @Auther tjk
* @Date 2022 08 03
**/
@Service
public
class
EquipmentFaultKnowledgeServiceImpl
extends
ServiceImpl
<
EquipmentFaultKnowledgeMapper
,
EquipmentFaultKnowledge
>
implements
IEquipmentFaultKnowledgeService
{
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
67924c9d
...
...
@@ -1001,13 +1001,13 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
if
(
this
.
baseMapper
.
selectCount
(
wrapper
)
==
0
)
{
Long
euqipId
=
equipmentSpecific
.
getEquipmentDetailId
();
String
eqcode
=
equipmentDetailService
.
getOneById
(
euqipId
).
getEqcode
();
//
String eqcode = equipmentDetailService.getOneById(euqipId).getEqcode();
boolean
b
=
equipmentDetailService
.
removeById
(
euqipId
);
if
(
b
){
/*
if(b){
Map<String, Object> map = new HashMap<>();
map.put("code",eqcode);
equipmentParamsService.removeByMap(map);
}
}
*/
}
if
(
res
>
0
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
67924c9d
...
...
@@ -56,6 +56,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
EquipmentParamsMapper
equipmentParamsMapper
;
@Autowired
IEquipmentSpecificSerivce
equipmentSpecificService
;
@Autowired
IRiskSourceSceneService
iRiskSourceSceneService
;
@Autowired
...
...
@@ -713,6 +719,22 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
detailssDTO
.
setStatus
(
0
);
}
IPage
<
DetailssAmountVO
>
list
=
fireFightingSystemMapper
.
getDetailAmountList
(
detailssDTO
.
getPage
(),
hierarchy
,
codeHead
,
detailssDTO
);
List
<
DetailssAmountVO
>
records
=
list
.
getRecords
();
for
(
DetailssAmountVO
da:
records
){
Long
id
=
da
.
getId
();
Long
EquipmentDetailId
=
equipmentSpecificService
.
getById
(
id
).
getEquipmentDetailId
();
QueryWrapper
<
EquipmentParams
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"detail_id"
,
EquipmentDetailId
);
wrapper
.
orderByDesc
(
"create_date"
);
//根据创建时间进行倒叙
List
<
EquipmentParams
>
equipmentParams
=
equipmentParamsMapper
.
selectList
(
wrapper
);
if
(!
equipmentParams
.
isEmpty
()){
EquipmentParams
params
=
equipmentParams
.
get
(
0
);
da
.
setStatus
(
params
.
getStatus
()==
0
?
"正常"
:
"故障"
);
}
else
{
da
.
setStatus
(
"正常"
);
}
}
// list.getRecords().forEach(x -> {
// if (!x.getEqtype().startsWith("4") && StringUtil.isNotEmpty(x.getAmount())) {
// x.setAmount(x.getAmount().split("\\.")[0]);
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentDetailMapper.xml
View file @
67924c9d
...
...
@@ -164,13 +164,13 @@
wled.standard,
wled.NAME name,
'equipment' AS type,
CASE
wlp.`status`
WHEN '0' THEN
'正常'
WHEN '1' THEN
'故障' ELSE '错误'
END AS STATUS,
--
CASE
--
wlp.`status`
--
WHEN '0' THEN
--
'正常'
--
WHEN '1' THEN
--
'故障' ELSE '错误'
--
END AS STATUS,
wled.remark,
wled.brand,
wled.area,
...
...
@@ -178,8 +178,8 @@
wled.eq_code,
wled.join_date,
wled.open_date,
wlp.reason,
wlp.measure,
--
wlp.reason,
--
wlp.measure,
wles.iot_code,
wled.equipment_id,
wled.equipment_name
...
...
@@ -188,7 +188,7 @@
LEFT JOIN ( SELECT id, qr_code, CODE, iot_code, create_date, equipment_detail_id, system_id FROM wl_equipment_specific ) wles ON wles.equipment_detail_id = wled.id
LEFT JOIN ( SELECT id, amount, STATUS, equipment_specific_id, warehouse_structure_id FROM wl_stock_detail ) wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws ON wlsd.warehouse_structure_id = wlws.id
LEFT JOIN wl_equipment_params wlp ON wlp.code = wled.eq_code
--
LEFT JOIN wl_equipment_params wlp ON wlp.code = wled.eq_code
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai ON wled.manufacturer_id = wlai.id
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
67924c9d
...
...
@@ -608,13 +608,13 @@
wled.standard,
wled.NAME name,
'equipment' AS type,
CASE
wlp.`status`
WHEN '0' THEN
'正常'
WHEN '1' THEN
'故障' ELSE '错误'
END AS STATUS,
--
CASE
--
wlp.`status`
--
WHEN '0' THEN
--
'正常'
--
WHEN '1' THEN
--
'故障' ELSE '错误'
--
END AS STATUS,
wled.remark,
wled.brand,
wled.area,
...
...
@@ -622,8 +622,8 @@
wled.eq_code,
wled.join_date,
wled.open_date,
wlp.reason,
wlp.measure,
/*
wlp.reason,
wlp.measure,
*/
wles.iot_code,
wled.equipment_id,
wled.equipment_name
...
...
@@ -632,7 +632,7 @@
LEFT JOIN ( SELECT id, qr_code, CODE, iot_code, create_date, equipment_detail_id, system_id FROM wl_equipment_specific ) wles ON wles.equipment_detail_id = wled.id
LEFT JOIN ( SELECT id, amount, STATUS, equipment_specific_id, warehouse_structure_id FROM wl_stock_detail ) wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws ON wlsd.warehouse_structure_id = wlws.id
LEFT JOIN wl_equipment_params wlp ON wlp.code = wled.eq_code
/* LEFT JOIN wl_equipment_params wlp ON wlp.code = wled.eq_code*/
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai ON wled.manufacturer_id = wlai.id
...
...
@@ -666,15 +666,15 @@
<if
test=
"detailssDTO.joinDate!=null"
>
and wled.join_date = #{detailssDTO.joinDate}
</if>
<if
test=
"detailssDTO.status!=null"
>
<!--
<if test="detailssDTO.status!=null">
and wlp.status = #{detailssDTO.status}
</if>
<if
test=
"detailssDTO.reason!=null"
>
</if>
-->
<!--
<if test="detailssDTO.reason!=null">
and wlp.reason = #{detailssDTO.reason}
</if>
<if test="detailssDTO.measure!=null">
and wled.measure = #{detailssDTO.measure}
</if>
</if>
-->
<if
test=
"detailssDTO.name!=null and detailssDTO.name!=''"
>
AND wled.name LIKE CONCAT('%',#{detailssDTO.name},'%')
</if>
...
...
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