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
2c2f7ce5
Commit
2c2f7ce5
authored
Mar 23, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug-972修复 电力设备添加配套设备查询接口
parent
6d6dc83f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
14 deletions
+99
-14
EquipmentCategory.java
...va/com/yeejoin/amos/fas/dao/entity/EquipmentCategory.java
+23
-2
EquipmentSpecificController.java
.../fas/business/controller/EquipmentSpecificController.java
+9
-1
EquipmentSpecificMapper.java
...amos/fas/business/dao/mapper/EquipmentSpecificMapper.java
+2
-2
EquipmentCategoryServiceImpl.java
...s/business/service/impl/EquipmentCategoryServiceImpl.java
+19
-0
EquipmentSpecificServiceImpl.java
...s/business/service/impl/EquipmentSpecificServiceImpl.java
+27
-9
EquipmentSpecificService.java
.../fas/business/service/intfc/EquipmentSpecificService.java
+2
-0
IEquipmentCategoryService.java
...fas/business/service/intfc/IEquipmentCategoryService.java
+5
-0
dbTemplate_equipment_specific.xml
...ain/resources/db/mapper/dbTemplate_equipment_specific.xml
+12
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/EquipmentCategory.java
View file @
2c2f7ce5
...
@@ -7,8 +7,10 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -7,8 +7,10 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.typroject.tyboot.core.foundation.utils.TreeNode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -22,7 +24,7 @@ import java.util.List;
...
@@ -22,7 +24,7 @@ import java.util.List;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"wl_equipment_category"
)
@TableName
(
"wl_equipment_category"
)
@ApiModel
(
value
=
"EquipmentCategory装备分类实体"
,
description
=
"装备分类"
)
@ApiModel
(
value
=
"EquipmentCategory装备分类实体"
,
description
=
"装备分类"
)
public
class
EquipmentCategory
extends
BaseEntity
{
public
class
EquipmentCategory
extends
BaseEntity
implements
TreeNode
<
EquipmentCategory
,
Long
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -56,5 +58,24 @@ public class EquipmentCategory extends BaseEntity {
...
@@ -56,5 +58,24 @@ public class EquipmentCategory extends BaseEntity {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
EquipmentCategory
>
children
=
new
ArrayList
<>();
//子集
private
List
<
EquipmentCategory
>
children
=
new
ArrayList
<>();
//子集
@Override
public
Long
getMyParentId
()
{
return
parentId
;
}
@Override
public
Long
getMyId
()
{
return
getId
();
}
@Override
public
void
setChildren
(
Collection
<
EquipmentCategory
>
collection
)
{
this
.
children
=
new
ArrayList
<>(
collection
);
}
@Override
public
int
compareTo
(
EquipmentCategory
o
)
{
return
this
.
getId
().
compareTo
(
o
.
getId
());
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentSpecificController.java
View file @
2c2f7ce5
...
@@ -88,7 +88,15 @@ public class EquipmentSpecificController extends BaseController{
...
@@ -88,7 +88,15 @@ public class EquipmentSpecificController extends BaseController{
return
CommonResponseUtil
.
success
(
equipmentSpecificService
.
getEquipmentBySpe
(
name
,
code
,
pageNumber
,
pageSize
,
equipmentId
));
return
CommonResponseUtil
.
success
(
equipmentSpecificService
.
getEquipmentBySpe
(
name
,
code
,
pageNumber
,
pageSize
,
equipmentId
));
}
}
@GetMapping
(
value
=
"/getEquipmentBySpeV2"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取装备台账信息"
,
notes
=
"获取装备台账信息"
)
public
CommonResponse
getEquipmentBySpeV2
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"pageNumber"
,
required
=
false
)
int
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
int
pageSize
,
@RequestParam
(
value
=
"equipmentId"
,
required
=
false
)
Long
equipmentId
)
{
return
CommonResponseUtil
.
success
(
equipmentSpecificService
.
getEquipmentBySpeV2
(
name
,
pageNumber
,
pageSize
,
equipmentId
));
}
@GetMapping
(
value
=
"/list-tree"
,
produces
=
"application/json;charset=UTF-8"
)
@GetMapping
(
value
=
"/list-tree"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全量数据树形结构返回"
,
notes
=
"全量数据树形结构返回"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全量数据树形结构返回"
,
notes
=
"全量数据树形结构返回"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/EquipmentSpecificMapper.java
View file @
2c2f7ce5
...
@@ -45,8 +45,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo>
...
@@ -45,8 +45,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo>
* @param equipmentId
* @param equipmentId
* @return
* @return
*/
*/
List
<
EquipmentSpecificVo
>
getEquipmentBySpe
(
@Param
(
"pageNumber"
)
int
pageNumber
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipmentId"
)
String
equipmentId
);
List
<
EquipmentSpecificVo
>
getEquipmentBySpe
(
@Param
(
"pageNumber"
)
int
pageNumber
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"equipmentIdList"
)
List
<
Long
>
equipmentIdList
);
int
getEquipmentBySpeCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipmentId"
)
String
equipmentId
);
int
getEquipmentBySpeCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"equipmentIdList"
)
List
<
Long
>
equipmentIdList
);
/**
/**
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentCategoryServiceImpl.java
View file @
2c2f7ce5
...
@@ -5,7 +5,11 @@ import com.yeejoin.amos.fas.business.service.intfc.IEquipmentCategoryService;
...
@@ -5,7 +5,11 @@ import com.yeejoin.amos.fas.business.service.intfc.IEquipmentCategoryService;
import
com.yeejoin.amos.fas.dao.entity.EquipmentCategory
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentCategory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.TreeBuilder
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -25,4 +29,19 @@ public class EquipmentCategoryServiceImpl implements IEquipmentCategoryService
...
@@ -25,4 +29,19 @@ public class EquipmentCategoryServiceImpl implements IEquipmentCategoryService
public
List
<
EquipmentCategory
>
list
(
)
{
public
List
<
EquipmentCategory
>
list
(
)
{
return
equipmentCategoryMapper
.
list
();
return
equipmentCategoryMapper
.
list
();
}
}
@Override
public
List
<
EquipmentCategory
>
getAllTree
(
Long
root
)
{
List
<
EquipmentCategory
>
list
=
equipmentCategoryMapper
.
list
();
if
(
list
.
isEmpty
())
{
return
Collections
.
emptyList
();
}
Long
root123
=
-
1L
;
list
.
forEach
(
eq
->
{
if
(
eq
.
getParentId
()
==
null
)
{
eq
.
setParentId
(
root123
);}});
if
(
root
==
null
)
{
root
=
root123
;
}
Collection
<
EquipmentCategory
>
bulid
=
TreeBuilder
.
bulid
(
list
,
root
);
return
new
ArrayList
<>(
bulid
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentSpecificServiceImpl.java
View file @
2c2f7ce5
...
@@ -3,19 +3,18 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -3,19 +3,18 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
import
com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificService
;
import
com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentCategoryService
;
import
com.yeejoin.amos.fas.business.util.TreeUtil
;
import
com.yeejoin.amos.fas.business.vo.AssoEquipsVo
;
import
com.yeejoin.amos.fas.business.vo.AssoEquipsVo
;
import
com.yeejoin.amos.fas.business.vo.EquipmentPointVo
;
import
com.yeejoin.amos.fas.business.vo.EquipmentPointVo
;
import
com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo
;
import
com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentCategory
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 装备配置 服务实现类
* 装备配置 服务实现类
...
@@ -28,7 +27,8 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
...
@@ -28,7 +27,8 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
@Autowired
@Autowired
EquipmentSpecificMapper
equipmentSpecificMapper
;
EquipmentSpecificMapper
equipmentSpecificMapper
;
@Autowired
IEquipmentCategoryService
categoryService
;
@Override
@Override
public
List
<
FmeaEquipmentPoint
>
upDateEquimentPoint
(
FmeaBindParam
fmeaBindParam
)
{
public
List
<
FmeaEquipmentPoint
>
upDateEquimentPoint
(
FmeaBindParam
fmeaBindParam
)
{
...
@@ -71,15 +71,33 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
...
@@ -71,15 +71,33 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
return
map
;
return
map
;
}
}
@Override
public
Map
<
String
,
Object
>
getEquipmentBySpeV2
(
String
name
,
int
pageNumber
,
int
pageSize
,
Long
equipmentId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
Long
>
equipmentIdList
=
null
;
if
(
equipmentId
!=
null
)
{
List
<
EquipmentCategory
>
allChildren
=
TreeUtil
.
getAllChildren
(
categoryService
.
getAllTree
(
equipmentId
));
equipmentIdList
=
new
LinkedList
<>();
equipmentIdList
.
add
(
equipmentId
);
if
(!
allChildren
.
isEmpty
()){
List
<
Long
>
finalEquipmentIdList
=
equipmentIdList
;
allChildren
.
forEach
(
cate
->
finalEquipmentIdList
.
add
(
cate
.
getId
()));
}
}
List
<
EquipmentSpecificVo
>
equipmentBySpe
=
equipmentSpecificMapper
.
getEquipmentBySpe
(
pageNumber
,
pageSize
,
name
,
null
,
null
,
equipmentIdList
);
int
equipmentBySpeCount
=
equipmentSpecificMapper
.
getEquipmentBySpeCount
(
name
,
null
,
null
,
equipmentIdList
);
map
.
put
(
"content"
,
equipmentBySpe
);
map
.
put
(
"totalElements"
,
equipmentBySpeCount
);
return
map
;
}
@Override
@Override
public
Map
<
String
,
Object
>
getEquipmentBySpe
(
String
name
,
String
code
,
int
pageNumber
,
int
pageSize
,
String
equipmentId
)
{
public
Map
<
String
,
Object
>
getEquipmentBySpe
(
String
name
,
String
code
,
int
pageNumber
,
int
pageSize
,
String
equipmentId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
pageNumber
=
pageNumber
*
pageSize
;
pageNumber
=
pageNumber
*
pageSize
;
code
=
checkid
(
code
);
code
=
checkid
(
code
);
List
<
EquipmentSpecificVo
>
equipmentBySpe
=
equipmentSpecificMapper
.
getEquipmentBySpe
(
pageNumber
,
pageSize
,
name
,
code
,
equipmentId
);
List
<
EquipmentSpecificVo
>
equipmentBySpe
=
equipmentSpecificMapper
.
getEquipmentBySpe
(
pageNumber
,
pageSize
,
name
,
code
,
equipmentId
,
null
);
int
equipmentBySpeCount
=
equipmentSpecificMapper
.
getEquipmentBySpeCount
(
name
,
code
,
equipmentId
);
int
equipmentBySpeCount
=
equipmentSpecificMapper
.
getEquipmentBySpeCount
(
name
,
code
,
equipmentId
,
null
);
map
.
put
(
"content"
,
equipmentBySpe
);
map
.
put
(
"content"
,
equipmentBySpe
);
map
.
put
(
"totalElements"
,
equipmentBySpeCount
);
map
.
put
(
"totalElements"
,
equipmentBySpeCount
);
return
map
;
return
map
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/EquipmentSpecificService.java
View file @
2c2f7ce5
...
@@ -53,4 +53,6 @@ public interface EquipmentSpecificService {
...
@@ -53,4 +53,6 @@ public interface EquipmentSpecificService {
* @return
* @return
*/
*/
Map
<
String
,
Object
>
getEquipmentBySpe
(
String
name
,
String
code
,
int
pageNumber
,
int
pageSize
,
String
equipmentId
);
Map
<
String
,
Object
>
getEquipmentBySpe
(
String
name
,
String
code
,
int
pageNumber
,
int
pageSize
,
String
equipmentId
);
Map
<
String
,
Object
>
getEquipmentBySpeV2
(
String
name
,
int
pageNumber
,
int
pageSize
,
Long
equipmentId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentCategoryService.java
View file @
2c2f7ce5
...
@@ -17,4 +17,9 @@ public interface IEquipmentCategoryService {
...
@@ -17,4 +17,9 @@ public interface IEquipmentCategoryService {
*/
*/
List
<
EquipmentCategory
>
list
(
);
List
<
EquipmentCategory
>
list
(
);
/**
* 获取装备树
* @return
*/
List
<
EquipmentCategory
>
getAllTree
(
Long
root
);
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_equipment_specific.xml
View file @
2c2f7ce5
...
@@ -60,6 +60,12 @@
...
@@ -60,6 +60,12 @@
<if
test=
"equipmentId != null and equipmentId!='null' "
>
<if
test=
"equipmentId != null and equipmentId!='null' "
>
and fire.equipment_id = #{equipmentId}
and fire.equipment_id = #{equipmentId}
</if>
</if>
<if
test=
"equipmentIdList != null and equipmentIdList.size > 0 "
>
and equ.category_id in
<foreach
collection=
"equipmentIdList"
item=
"equipmentId"
open=
"("
close=
")"
separator=
","
>
#{equipmentId}
</foreach>
</if>
limit #{pageNumber},#{pageSize}
limit #{pageNumber},#{pageSize}
</select>
</select>
...
@@ -86,6 +92,12 @@
...
@@ -86,6 +92,12 @@
<if
test=
"equipmentId != null and equipmentId!='null' "
>
<if
test=
"equipmentId != null and equipmentId!='null' "
>
and fire.equipment_id = #{equipmentId}
and fire.equipment_id = #{equipmentId}
</if>
</if>
<if
test=
"equipmentIdList != null and equipmentIdList.size > 0 "
>
and equ.category_id in
<foreach
collection=
"equipmentIdList"
item=
"equipmentId"
open=
"("
close=
")"
separator=
","
>
#{equipmentId}
</foreach>
</if>
</select>
</select>
<select
id=
"getFireEquiments"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipmentSpeVo"
>
<select
id=
"getFireEquiments"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipmentSpeVo"
>
select
select
...
...
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