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
1be12148
Commit
1be12148
authored
Mar 07, 2025
by
luben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
40fd5f63
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
18 deletions
+64
-18
CompanyController.java
...java/com/ruoyi/web/controller/grid/CompanyController.java
+37
-16
CompanyLabel.java
.../main/java/com/ruoyi/system/domain/grid/CompanyLabel.java
+14
-0
CompanyLabelLevelOne.java
...va/com/ruoyi/system/domain/grid/CompanyLabelLevelOne.java
+11
-0
GridCompanyMapper.xml
...stem/src/main/resources/mapper/grid/GridCompanyMapper.xml
+2
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/grid/CompanyController.java
View file @
1be12148
package
com
.
ruoyi
.
web
.
controller
.
grid
;
import
cn.hutool.json.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.ruoyi.common.core.controller.BaseController
;
...
...
@@ -7,10 +8,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.bean.BeanCopyUtil
;
import
com.ruoyi.common.zqt.ZQTPageUtil
;
import
com.ruoyi.system.domain.grid.GridCompany
;
import
com.ruoyi.system.domain.grid.GridCompanyEconomy
;
import
com.ruoyi.system.domain.grid.GridCompanyPeople
;
import
com.ruoyi.system.domain.grid.GridRegion
;
import
com.ruoyi.system.domain.grid.*
;
import
com.ruoyi.system.domain.grid.enums.GridCompanyLevelEnum
;
import
com.ruoyi.system.domain.grid.ext.GridCompanyExt
;
import
com.ruoyi.system.domain.grid.ext.GridCompanyPeopleExt
;
...
...
@@ -27,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.Arrays
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -217,14 +212,40 @@ public class CompanyController extends BaseController {
return
AjaxResult
.
success
(
gridCompanyService
.
getAllCompanyList
(
param
));
}
@GetMapping
(
"/saveLabel"
)
public
AjaxResult
saveLabel
(
@RequestParam
(
value
=
"id"
)
String
id
,
@RequestParam
(
value
=
"label"
)
String
label
){
return
AjaxResult
.
success
(
gridCompanyMapper
.
insertLabelById
(
id
,
label
));
}
@GetMapping
(
"/selectLabel"
)
public
AjaxResult
selectLabel
(
@RequestParam
(
value
=
"id"
)
String
id
){
return
AjaxResult
.
success
(
gridCompanyMapper
.
selectLabelById
(
id
));
// @GetMapping("/saveLabel")
// public AjaxResult saveLabel(@RequestParam(value = "id")String id,@RequestParam(value = "label")String label){
// return AjaxResult.success(gridCompanyMapper.insertLabelById(id,label));
// }
//
// @GetMapping("/selectLabel")
// public AjaxResult selectLabel(@RequestParam(value = "id")String id){
// return AjaxResult.success(gridCompanyMapper.selectLabelById(id));
// }
@PostMapping
(
"/saveCompanyLabel"
)
public
AjaxResult
saveCompanyLabel
(
@RequestBody
CompanyLabel
companyLabel
){
String
id
=
companyLabel
.
getId
();
List
<
CompanyLabelLevelOne
>
labels
=
companyLabel
.
getLabels
();
String
strLabel
=
""
;
for
(
CompanyLabelLevelOne
label
:
labels
)
{
strLabel
+=
label
.
getLevelTwo
()+
":"
+
label
.
getValue
()+
","
;
}
return
AjaxResult
.
success
(
gridCompanyMapper
.
insertLabelById
(
id
,
strLabel
));
}
@GetMapping
(
"/selectCompanyLabel"
)
public
AjaxResult
selectCompanyLabel
(
@RequestParam
(
"id"
)
String
id
){
String
label
=
gridCompanyMapper
.
selectLabelById
(
id
);
List
<
CompanyLabelLevelOne
>
res
=
new
ArrayList
<>();
List
<
String
>
labels
=
Arrays
.
asList
(
label
.
split
(
","
));
for
(
String
labelTwo
:
labels
)
{
List
<
String
>
labelTwos
=
Arrays
.
asList
(
labelTwo
.
split
(
":"
));
CompanyLabelLevelOne
companyLabel
=
new
CompanyLabelLevelOne
();
companyLabel
.
setLevelTwo
(
labelTwos
.
get
(
0
));
companyLabel
.
setValue
(
labelTwos
.
get
(
1
));
res
.
add
(
companyLabel
);
}
return
AjaxResult
.
success
(
res
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/grid/CompanyLabel.java
0 → 100644
View file @
1be12148
package
com
.
ruoyi
.
system
.
domain
.
grid
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
CompanyLabel
{
String
id
;
List
<
CompanyLabelLevelOne
>
labels
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/grid/CompanyLabelLevelOne.java
0 → 100644
View file @
1be12148
package
com
.
ruoyi
.
system
.
domain
.
grid
;
import
lombok.Data
;
@Data
public
class
CompanyLabelLevelOne
{
//二级标签对应的id
String
levelTwo
;
String
value
;
}
ruoyi-system/src/main/resources/mapper/grid/GridCompanyMapper.xml
View file @
1be12148
...
...
@@ -557,8 +557,8 @@
</select>
<insert
id=
"insertLabelById"
>
insert into
grid_company
(label) values (#{label,jdbcType=VARCHAR})
update
grid_company
set label = #{label,jdbcType=VARCHAR}
where id = #{id}
</insert>
</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