Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4462d372
authored
Jul 07, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实现获取技能组列表
1 parent
3fb08783
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/SkillController.java
project-order/src/main/java/com/dituhui/pea/order/service/SkillGroupCategoryService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/SkillGroupCategoryServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/SkillController.java
0 → 100644
View file @
4462d37
package
com
.
dituhui
.
pea
.
order
.
controller
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.service.SkillGroupCategoryService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
"/pea-order"
)
public
class
SkillController
{
@Autowired
SkillGroupCategoryService
skillGroupCategoryService
;
@GetMapping
(
"/pea-order/skill/group/category"
)
public
Result
<?>
skillGroupCategory
()
{
Result
<?>
res
=
null
;
try
{
res
=
skillGroupCategoryService
.
querySkillGroupCategoryService
();
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
}
project-order/src/main/java/com/dituhui/pea/order/service/SkillGroupCategoryService.java
0 → 100644
View file @
4462d37
package
com
.
dituhui
.
pea
.
order
.
service
;
import
com.dituhui.pea.common.Result
;
public
interface
SkillGroupCategoryService
{
public
Result
<?>
querySkillGroupCategoryService
();
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/SkillGroupCategoryServiceImpl.java
0 → 100644
View file @
4462d37
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dao.SkillGroupMPDao
;
import
com.dituhui.pea.order.entity.SkillGroup
;
import
com.dituhui.pea.order.service.SkillGroupCategoryService
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
public
class
SkillGroupCategoryServiceImpl
implements
SkillGroupCategoryService
{
@Autowired
SkillGroupMPDao
skillGroupMPDao
;
@Override
public
Result
<?>
querySkillGroupCategoryService
()
{
List
<
SkillGroup
>
records
=
skillGroupMPDao
.
selectList
(
null
).
stream
().
sorted
(
Comparator
.
comparing
(
SkillGroup:
:
getCategory
)).
collect
(
Collectors
.
toList
());
List
<
Category
>
items
=
new
ArrayList
<>();
for
(
SkillGroup
r
:
records
)
{
items
.
add
(
new
Category
(
r
.
getSkillGroupCode
(),
r
.
getSkillGroup
(),
r
.
getCategory
()));
}
Response
res
=
new
Response
();
res
.
setCategories
(
items
);
return
Result
.
success
(
res
);
}
}
@Data
class
Response
{
private
List
<
Category
>
categories
;
}
@Data
class
Category
{
private
String
skillGroupId
;
private
String
category
;
private
String
skillGroupName
;
public
Category
(
String
skillGroupId
,
String
skillGroupName
,
String
category
)
{
this
.
category
=
category
;
this
.
skillGroupName
=
skillGroupName
;
this
.
skillGroupId
=
skillGroupId
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment