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
f4ca8002
Commit
f4ca8002
authored
Jan 20, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix:
1、管道品种级联筛选
parent
62be67c6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
9 deletions
+92
-9
EquipmentClassifyDto.java
...oin/amos/boot/module/jg/api/dto/EquipmentClassifyDto.java
+26
-0
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+29
-0
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+4
-3
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+2
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+31
-3
EquipmentCategoryMapper.java
...s/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
+0
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/EquipmentClassifyDto.java
0 → 100644
View file @
f4ca8002
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 装备分类
*
* @author system_generator
* @date 2021-10-20
*/
@Data
@ApiModel
(
value
=
"EquipmentClassifyDto"
,
description
=
"装备分类"
)
public
class
EquipmentClassifyDto
extends
EquipmentCategoryDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"children"
)
private
List
<
EquipmentClassifyDto
>
children
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
f4ca8002
...
@@ -7,9 +7,11 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
...
@@ -7,9 +7,11 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO
;
import
com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO
;
import
com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReportAnalysisSearchDTO
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReportAnalysisSearchDTO
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -230,5 +232,32 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
...
@@ -230,5 +232,32 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
@Param
(
"record"
)
String
record
);
@Param
(
"record"
)
String
record
);
void
updateEnterpriseSafetyStatus
(
@Param
(
"useUnitCodeList"
)
Set
<
String
>
useUnitCodeList
);
void
updateEnterpriseSafetyStatus
(
@Param
(
"useUnitCodeList"
)
Set
<
String
>
useUnitCodeList
);
@Select
(
"WITH RECURSIVE category_tree AS (\n"
+
" SELECT \n"
+
" tt.id,\n"
+
" tt.code,\n"
+
" tt.name,\n"
+
" ifnull((SELECT code FROM tz_equipment_category WHERE id = tt.parent_id), 0) parent_id,\n"
+
" 1 AS level -- 定义当前级别为1\n"
+
" FROM \n"
+
" tz_equipment_category tt\n"
+
" WHERE \n"
+
" code = #{parentCode}\n"
+
" UNION ALL\n"
+
" -- 递归成员:从子节点继续查找\n"
+
" SELECT \n"
+
" child.id,\n"
+
" child.code,\n"
+
" child.name,\n"
+
" (SELECT code FROM tz_equipment_category WHERE id = child.parent_id) parent_id,\n"
+
" parent.level + 1 \n"
+
" FROM \n"
+
" tz_equipment_category child\n"
+
" INNER JOIN \n"
+
" category_tree parent ON child.parent_id = parent.id\n"
+
")\n"
+
"SELECT * FROM category_tree ORDER BY level;"
)
List
<
EquipmentClassifyDto
>
getEquClassifyByCode
(
String
parentCode
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/CommonController.java
View file @
f4ca8002
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CodeGenerateDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CodeGenerateDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
...
@@ -689,9 +690,9 @@ public class CommonController extends BaseController {
...
@@ -689,9 +690,9 @@ public class CommonController extends BaseController {
* @return list
* @return list
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/get
SubEquCategoryByParent
"
)
@GetMapping
(
value
=
"/get
EquClassifyByCode
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据父级code查询子设备分类"
,
notes
=
"根据父级code查询子设备分类"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据父级code查询子设备分类"
,
notes
=
"根据父级code查询子设备分类"
)
public
ResponseModel
<
List
<
EquipmentC
ategoryDto
>>
getSubEquCategoryByParent
(
@RequestParam
(
value
=
"parentCode"
)
String
parentCode
)
{
public
ResponseModel
<
List
<
EquipmentC
lassifyDto
>>
getEquClassifyByCode
(
@RequestParam
(
value
=
"parentCode"
)
String
parentCode
)
{
return
ResponseHelper
.
buildResponse
(
commonService
.
get
SubEquCategoryByParent
Code
(
parentCode
));
return
ResponseHelper
.
buildResponse
(
commonService
.
get
EquClassifyBy
Code
(
parentCode
));
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
f4ca8002
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.InstanceRuntimeData
;
import
com.yeejoin.amos.boot.module.jg.api.dto.InstanceRuntimeData
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
...
@@ -242,5 +243,5 @@ public interface ICommonService {
...
@@ -242,5 +243,5 @@ public interface ICommonService {
List
<
EquipmentCategoryDto
>
getEquDefineByParentId
(
String
parentId
);
List
<
EquipmentCategoryDto
>
getEquDefineByParentId
(
String
parentId
);
List
<
EquipmentC
ategoryDto
>
getSubEquCategoryByParent
Code
(
String
parentCode
);
List
<
EquipmentC
lassifyDto
>
getEquClassifyBy
Code
(
String
parentCode
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
f4ca8002
...
@@ -2123,9 +2123,37 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2123,9 +2123,37 @@ public class CommonServiceImpl implements ICommonService {
}
}
@Override
@Override
public
List
<
EquipmentCategoryDto
>
getSubEquCategoryByParentCode
(
String
parentCode
)
{
public
List
<
EquipmentClassifyDto
>
getEquClassifyByCode
(
String
parentCode
)
{
return
equipmentCategoryMapper
.
getSubEquCategoryByParentCode
(
parentCode
);
List
<
EquipmentClassifyDto
>
equipmentCategoryDtos
=
commonMapper
.
getEquClassifyByCode
(
parentCode
);
}
if
(
ValidationUtil
.
isEmpty
(
equipmentCategoryDtos
))
{
return
new
ArrayList
<>();
}
Map
<
String
,
EquipmentClassifyDto
>
idToDtoMap
=
equipmentCategoryDtos
.
stream
()
.
collect
(
Collectors
.
toMap
(
EquipmentClassifyDto:
:
getCode
,
dto
->
dto
));
List
<
EquipmentClassifyDto
>
rootNodes
=
equipmentCategoryDtos
.
stream
()
.
filter
(
dto
->
dto
.
getParentId
().
equals
(
"0"
))
.
collect
(
Collectors
.
toList
());
equipmentCategoryDtos
.
forEach
(
dto
->
{
String
parentId
=
dto
.
getParentId
();
if
(!
ValidationUtil
.
isEmpty
(
parentId
))
{
EquipmentClassifyDto
parent
=
idToDtoMap
.
get
(
parentId
);
if
(
parent
!=
null
)
{
if
(
parent
.
getChildren
()
==
null
)
{
parent
.
setChildren
(
new
ArrayList
<>());
}
parent
.
getChildren
().
add
(
dto
);
}
}
});
return
rootNodes
.
stream
()
.
flatMap
(
root
->
root
.
getChildren
().
stream
())
.
collect
(
Collectors
.
toList
());
}
/**
/**
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
View file @
f4ca8002
...
@@ -101,7 +101,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
...
@@ -101,7 +101,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select
(
"SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}"
)
@Select
(
"SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}"
)
List
<
EquipmentCategoryDto
>
getEquDefineByParentId
(
String
parentId
);
List
<
EquipmentCategoryDto
>
getEquDefineByParentId
(
String
parentId
);
@Select
(
"SELECT * FROM tz_equipment_category WHERE parent_id = ( SELECT ID FROM tz_equipment_category WHERE code = #{parentCode} )"
)
List
<
EquipmentCategoryDto
>
getSubEquCategoryByParentCode
(
String
parentCode
);
}
}
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