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 43839c13
authored
Jul 07, 2023
by
王力
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_engineer_filter' into 'develop'
Dev engineer filter See merge request !171
2 parents
8041eba5
05b1ac9a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
18 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/SkillController.java
project-order/src/main/java/com/dituhui/pea/order/entity/SkillGroup.java
project-order/src/main/java/com/dituhui/pea/order/entity/SkillInfo.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 @
43839c1
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/entity/SkillGroup.java
View file @
43839c1
...
@@ -2,25 +2,17 @@ package com.dituhui.pea.order.entity;
...
@@ -2,25 +2,17 @@ package com.dituhui.pea.order.entity;
import
lombok.Data
;
import
lombok.Data
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
@Data
@Data
public
class
SkillGroup
{
public
class
SkillGroup
{
private
Integer
id
;
private
Integer
id
;
private
String
skillCode
;
private
String
brand
;
private
String
type
;
private
String
skill
;
private
Integer
takeTime
;
private
Integer
takeEngineer
;
private
Integer
lowElectricianCert
;
private
Integer
gasCert
;
private
Integer
priority
;
private
String
skillGroupCode
;
private
String
skillGroupCode
;
private
String
layerId
;
private
String
skillGroup
;
private
String
typeCategory
;
private
String
describe
;
private
String
skillC
ategory
;
private
String
c
ategory
;
private
String
memo
;
private
String
memo
;
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
private
LocalDate
Time
updateTime
;
private
LocalDate
updateTime
;
}
}
project-order/src/main/java/com/dituhui/pea/order/entity/SkillInfo.java
View file @
43839c1
...
@@ -2,17 +2,25 @@ package com.dituhui.pea.order.entity;
...
@@ -2,17 +2,25 @@ package com.dituhui.pea.order.entity;
import
lombok.Data
;
import
lombok.Data
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
@Data
@Data
public
class
SkillInfo
{
public
class
SkillInfo
{
private
Integer
id
;
private
Integer
id
;
private
String
skillCode
;
private
String
brand
;
private
String
type
;
private
String
skill
;
private
Integer
takeTime
;
private
Integer
takeEngineer
;
private
Integer
lowElectricianCert
;
private
Integer
gasCert
;
private
Integer
priority
;
private
String
skillGroupCode
;
private
String
skillGroupCode
;
private
String
skillGroup
;
private
String
layerId
;
private
String
describe
;
private
String
typeCategory
;
private
String
c
ategory
;
private
String
skillC
ategory
;
private
String
memo
;
private
String
memo
;
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
private
LocalDate
updateTime
;
private
LocalDate
Time
updateTime
;
}
}
project-order/src/main/java/com/dituhui/pea/order/service/SkillGroupCategoryService.java
0 → 100644
View file @
43839c1
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 @
43839c1
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