Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
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
yichengstreet
yichengstreet-be
Commits
df2e004f
Commit
df2e004f
authored
Mar 10, 2025
by
luben
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'main'
Dev See merge request
!78
parents
dc1e6912
c4deb26e
Pipeline
#143023
passed with stages
in 3 minutes and 38 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
LabelsController.java
...java/com/ruoyi/web/controller/other/LabelsController.java
+10
-0
LabelsMapper.java
...main/java/com/ruoyi/system/mapper/other/LabelsMapper.java
+2
-0
LabelsFacadeService.java
...a/com/ruoyi/system/service/other/LabelsFacadeService.java
+27
-0
LabelsMapper.xml
...i-system/src/main/resources/mapper/other/LabelsMapper.xml
+3
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/other/LabelsController.java
View file @
df2e004f
...
...
@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -113,4 +114,13 @@ public class LabelsController extends BaseController {
return
JSON
.
toJSONString
(
AjaxResult
.
error
(
500
,
"服务器内部错误"
));
}
}
@ApiOperation
(
"三级返回整个树"
)
@RequestMapping
(
value
=
"/threeToTree"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
AjaxResult
threeToTree
()
{
List
<
String
>
codes
=
new
ArrayList
<
String
>();
codes
.
add
(
"company_type_tec"
);
return
commonService
.
threeToTree
(
codes
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/other/LabelsMapper.java
View file @
df2e004f
...
...
@@ -29,4 +29,6 @@ public interface LabelsMapper {
int
updateByExample
(
@Param
(
"record"
)
Labels
record
,
@Param
(
"example"
)
LabelsExample
example
);
List
<
Labels
>
getWgdxList
(
String
code
);
String
getDegreeOne
(
String
code
);
}
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/service/other/LabelsFacadeService.java
View file @
df2e004f
...
...
@@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import
com.ruoyi.system.domain.other.Labels
;
import
com.ruoyi.system.domain.other.LabelsExample
;
import
com.ruoyi.system.domain.other.vo.LabelsVO
;
import
com.ruoyi.system.mapper.other.LabelsMapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -24,6 +25,9 @@ public class LabelsFacadeService {
@Autowired
private
LabelsService
bsCommonService
;
@Autowired
private
LabelsMapper
labelsMapper
;
public
String
commit
(
Labels
body
,
String
method
)
{
try
{
AjaxResult
result
=
new
AjaxResult
();
...
...
@@ -276,4 +280,27 @@ public class LabelsFacadeService {
}
return
item
.
matches
(
"(\\w{8}(-\\w{4}){3}-\\w{12}?)"
);
}
public
AjaxResult
threeToTree
(
List
<
String
>
codes
){
Set
<
String
>
codeSet
=
new
HashSet
<>();
List
<
Labels
>
bsCommons
=
new
ArrayList
<>();
for
(
String
code
:
codes
){
String
degree_one
=
labelsMapper
.
getDegreeOne
(
code
);
codeSet
.
add
(
degree_one
);
}
for
(
String
code
:
codeSet
){
LabelsExample
bsCommonExample
=
new
LabelsExample
();
LabelsExample
.
Criteria
criteria
=
bsCommonExample
.
createCriteria
();
criteria
.
andIsValidEqualTo
(
"1"
);
if
(
StringUtils
.
isNotBlank
(
code
)){
criteria
.
andCodeLike
(
"%"
+
code
+
"%"
);
}
bsCommonExample
.
setOrderByClause
(
" sort + 0 "
);
List
<
Labels
>
bsCommon
=
bsCommonService
.
selectByExample
(
bsCommonExample
);
bsCommons
.
addAll
(
bsCommon
);
}
List
<
Map
<
String
,
Object
>>
jsTreeModels
=
convertFrBomsCommon
(
bsCommons
);
return
AjaxResult
.
success
(
jsTreeModels
);
}
}
ruoyi-system/src/main/resources/mapper/other/LabelsMapper.xml
View file @
df2e004f
...
...
@@ -219,6 +219,9 @@
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"getDegreeOne"
resultType=
"java.lang.String"
>
select code from labels where id = (select parent_id from labels where id = (select parent_id from labels where code = #{code}))
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update labels
<set>
...
...
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