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
5297af3f
Commit
5297af3f
authored
Apr 12, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
3ec231ac
099cf363
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
185 additions
and
45 deletions
+185
-45
EquipmentCategory.java
.../yeejoin/equipmanage/common/entity/EquipmentCategory.java
+4
-0
EquipmentCategoryController.java
...n/equipmanage/controller/EquipmentCategoryController.java
+55
-11
EquipmentCategoryMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentCategoryMapper.java
+7
-2
IEquipmentCategoryService.java
...eejoin/equipmanage/service/IEquipmentCategoryService.java
+7
-2
EquipmentCategoryServiceImpl.java
...quipmanage/service/impl/EquipmentCategoryServiceImpl.java
+15
-4
EquipmentCategoryMapper.xml
...uip/src/main/resources/mapper/EquipmentCategoryMapper.xml
+97
-26
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentCategory.java
View file @
5297af3f
...
...
@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC
@ApiModelProperty
(
value
=
"个数"
)
private
Double
count
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"个数"
)
private
String
countName
;
@ApiModelProperty
(
value
=
"类型(car:车辆 equipment:装备)"
)
@TableField
(
exist
=
false
)
private
String
type
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentCategoryController.java
View file @
5297af3f
...
...
@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController {
return
list
;
}
@RequestMapping
(
value
=
"/itemType-tree"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"检查项类型统计树"
,
notes
=
"检查项类型统计树"
)
public
List
<
EquipmentCategory
>
countItemTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
equipmentCategories
=
this
.
listEquip
();
List
<
EquipmentCategory
>
fireCategories
=
this
.
listFire
();
fireCategories
.
get
(
0
).
setId
(-
2L
);
fireCategories
.
get
(
0
).
setCode
(
"-2"
);
List
<
EquipmentCategory
>
treeListByCustom
=
getTreeListByCustom
(
bizOrgCode
);
list
.
addAll
(
equipmentCategories
);
list
.
addAll
(
fireCategories
);
list
.
addAll
(
treeListByCustom
);
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
list
);
equipmentCategory
.
setCode
(
"-3"
);
equipmentCategory
.
setName
(
"全部类型"
);
equipmentCategory
.
setId
(-
3L
);
int
countAll
=
StringUtils
.
isNotEmpty
(
bizOrgCode
)
?
equipmentCategoryMapper
.
countAll
(
bizOrgCode
)
:
0
;
equipmentCategory
.
setCountName
(
"全部类型"
+
"("
+
countAll
+
")"
);
equipmentCategory
.
setHasLowerClassification
(
true
);
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
result
.
add
(
equipmentCategory
);
return
result
;
}
/**
* 除消防设施全量数据树形结构返回
...
...
@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"除消防设施全量数据树形结构返回"
,
notes
=
"除消防设施全量数据树形结构返回"
)
public
List
<
EquipmentCategory
>
listEquip
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
.
getEquipmentCategoryListNotFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
.
getEquipmentCategoryListNotFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
)
,
bizOrgCode
);
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
...
...
@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
}
});
String
equipItemCount
=
iEquipmentCategoryService
.
getEquipItemCount
(
bizOrgCode
);
getChildren
(
list
,
tmpMap
);
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
list
);
equipmentCategory
.
setCode
(
"-1"
);
equipmentCategory
.
setName
(
"消防设备"
);
equipmentCategory
.
setCountName
(
"消防设备"
+
equipItemCount
);
equipmentCategory
.
setId
(
0L
);
equipmentCategory
.
setHasLowerClassification
(
true
);
...
...
@@ -336,9 +371,14 @@ public class EquipmentCategoryController extends AbstractBaseController {
@RequestMapping
(
value
=
"/list-tree-fire"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"消防设施分类定义树"
,
notes
=
"消防设施分类定义树"
)
public
List
<
EquipmentCategory
>
listFire
()
{
public
ResponseModel
<
List
<
EquipmentCategory
>>
listFire
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
if
(
redisUtils
.
hasKey
(
EQUIP_AND_FIRE_TREE
+
bizOrgCode
))
{
return
CommonResponseUtil
.
success
(
redisUtils
.
get
(
EQUIP_AND_FIRE_TREE
+
bizOrgCode
));
}
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
.
getEquipmentCategoryListByFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
.
getEquipmentCategoryListByFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
)
,
bizOrgCode
);
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
...
...
@@ -358,16 +398,18 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
});
getChildren
(
list
,
tmpMap
);
String
fireItemCount
=
iEquipmentCategoryService
.
getFireItemCount
(
bizOrgCode
);
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
list
);
equipmentCategory
.
setCode
(
"-1"
);
equipmentCategory
.
setName
(
"消防设施"
);
equipmentCategory
.
setCountName
(
"消防设施"
+
fireItemCount
);
equipmentCategory
.
setId
(
0L
);
equipmentCategory
.
setHasLowerClassification
(
true
);
result
.
add
(
equipmentCategory
);
return
result
;
redisUtils
.
set
(
EQUIP_AND_FIRE_TREE
+
bizOrgCode
,
result
,
172800
);
return
CommonResponseUtil
.
success
(
result
);
}
...
...
@@ -388,9 +430,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
listFireCategories
=
listFirePrivate
(
bizOrgCode
);
List
<
EquipmentCategory
>
listEquipCategories
=
listEquipPrivate
(
bizOrgCode
);
//
List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
List
<
EquipmentCategory
>
treeListByCustom
=
getTreeListByCustom
(
bizOrgCode
);
listFireCategories
.
addAll
(
listEquipCategories
);
//
listFireCategories.addAll(listEquipCategories);
listFireCategories
.
addAll
(
treeListByCustom
);
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
listFireCategories
);
...
...
@@ -416,6 +458,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int
keyPartsTypeCount
=
StringUtils
.
isNotEmpty
(
bizOrgCode
)
?
equipmentCategoryMapper
.
countByKeyPartsType
(
bizOrgCode
)
:
0
;
equipmentCategory
.
setCode
(
"-4"
);
equipmentCategory
.
setName
(
"重点部位"
+
"("
+
keyPartsTypeCount
+
")"
);
equipmentCategory
.
setCountName
(
"重点部位"
+
"("
+
keyPartsTypeCount
+
")"
);
equipmentCategory
.
setPatrolNum
(
keyPartsTypeCount
);
equipmentCategory
.
setId
(-
4L
);
equipmentCategory
.
setParentId
(-
3L
);
...
...
@@ -425,6 +468,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int
customTypeCount
=
StringUtils
.
isNotEmpty
(
bizOrgCode
)
?
equipmentCategoryMapper
.
countByCustomType
(
bizOrgCode
)
:
0
;
equipmentCategory2
.
setCode
(
"-5"
);
equipmentCategory2
.
setName
(
"自定义巡查点"
+
"("
+
customTypeCount
+
")"
);
equipmentCategory2
.
setCountName
(
"自定义巡查点"
+
"("
+
customTypeCount
+
")"
);
equipmentCategory2
.
setPatrolNum
(
customTypeCount
);
equipmentCategory2
.
setId
(-
5L
);
equipmentCategory2
.
setParentId
(-
3L
);
...
...
@@ -433,9 +477,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
return
result
;
}
private
List
<
EquipmentCategory
>
listFirePrivate
(
String
bizOrgCode
)
{
private
List
<
EquipmentCategory
>
listFirePrivate
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
.
getEquipmentCategoryListByFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
.
getEquipmentCategoryListByFacilities
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
)
,
bizOrgCode
);
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
...
...
@@ -475,7 +519,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
private
List
<
EquipmentCategory
>
listEquipPrivate
(
String
bizOrgCode
)
{
/*
private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>();
...
...
@@ -510,7 +554,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
equipmentCategory.setParentId(-3L);
result.add(equipmentCategory);
return result;
}
}
*/
/**
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentCategoryMapper.java
View file @
5297af3f
...
...
@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
int
checkUsed
(
String
id
);
List
<
EquipmentCategory
>
getEquipmentCategoryList
(
Integer
head
);
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
);
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
,
String
bizOrgCode
);
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
);
String
getEquipItemCount
(
String
bizOrgCode
)
;
String
getFireItemCount
(
String
bizOrgCode
)
;
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
,
String
bizOrgCode
);
int
countByFireTypeAndCode
(
@Param
(
"code"
)
String
code
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentCategoryService.java
View file @
5297af3f
...
...
@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List
<
EquipmentCategory
>
getEquipmentCategoryList
(
Integer
head
);
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
)
;
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
,
String
bizOrgCode
)
;
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
)
;
String
getEquipItemCount
(
String
bizOrgCode
)
;
String
getFireItemCount
(
String
bizOrgCode
)
;
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
,
String
bizOrgCode
)
;
/**
* 根据分类定义id获取对应所有子分类id
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentCategoryServiceImpl.java
View file @
5297af3f
...
...
@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
return
this
.
baseMapper
.
getEquipmentCategoryList
(
head
);
}
public
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
)
{
return
this
.
baseMapper
.
getEquipmentCategoryListNotFacilities
(
head
);
public
List
<
EquipmentCategory
>
getEquipmentCategoryListNotFacilities
(
Integer
head
,
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getEquipmentCategoryListNotFacilities
(
head
,
bizOrgCode
);
}
public
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
)
{
return
this
.
baseMapper
.
getEquipmentCategoryListByFacilities
(
head
);
public
String
getFireItemCount
(
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getFireItemCount
(
bizOrgCode
);
}
public
String
getEquipItemCount
(
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getEquipItemCount
(
bizOrgCode
);
}
public
List
<
EquipmentCategory
>
getEquipmentCategoryListByFacilities
(
Integer
head
,
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getEquipmentCategoryListByFacilities
(
head
,
bizOrgCode
);
}
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
5297af3f
...
...
@@ -309,6 +309,23 @@
ec.parent_id,
ec.CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
...
...
@@ -326,38 +343,72 @@
<select
id=
"getEquipmentCategoryListByFacilities"
resultMap=
"Category"
>
SELECT ec.id,
ec.parent_id,
ec.CODE,
ec.NAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
ec.parent_id,
ec.CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code
left join wl_industry i on ec.industry_code = i.code
WHERE
ec.code LIKE CONCAT ('930','%')
ec.code LIKE CONCAT ('930','%')
UNION ALL
SELECT ec.id,
ec.parent_id,
ec.code as CODE,
ec.NAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
ec.parent_id,
ec.code as CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', 'LSHLZ1yOrS3WfXqzjn', '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code
left join wl_industry i on ec.industry_code = i.code
WHERE
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
ec.code like CONCAT ('92', '%')
</select>
...
...
@@ -555,4 +606,24 @@
AND is_delete = '0'
AND input_type!='1'
</select>
<select
id=
"getEquipItemCount"
resultType=
"java.lang.String"
>
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.equipment_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
<select
id=
"getFireItemCount"
resultType=
"java.lang.String"
>
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.facilities_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
</mapper>
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