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 10c06d10
authored
Jul 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
layerId, skillGroupCode,翻译为对应的中文返回
1 parent
b1e7c906
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
4 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerCustomizeDao.java
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerDao.java
project-order/src/main/java/com/dituhui/pea/order/dao/SkillGroupDao.java
project-order/src/main/java/com/dituhui/pea/order/dto/BusinessSkillListDTO.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomizeEntity.java
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBaseServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerCustomizeDao.java
0 → 100644
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
dao
;
import
com.dituhui.pea.order.entity.MapLayerCustomizeEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
MapLayerCustomizeDao
extends
JpaRepository
<
MapLayerCustomizeEntity
,
Long
>
{
}
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerDao.java
0 → 100644
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
dao
;
import
com.dituhui.pea.order.entity.MapLayerEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
MapLayerDao
extends
JpaRepository
<
MapLayerEntity
,
Long
>
{
MapLayerEntity
getByLayerId
(
String
layerId
);
}
project-order/src/main/java/com/dituhui/pea/order/dao/SkillGroupDao.java
0 → 100644
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
dao
;
import
com.dituhui.pea.order.entity.SkillGroupEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
SkillGroupDao
extends
JpaRepository
<
SkillGroupEntity
,
Long
>
{
}
project-order/src/main/java/com/dituhui/pea/order/dto/BusinessSkillListDTO.java
View file @
10c06d1
...
...
@@ -40,14 +40,16 @@ public class BusinessSkillListDTO {
private
String
brand
;
private
LocalDateTime
createTime
;
private
Boolean
gasCert
;
private
Object
layerId
;
private
String
layerId
;
private
String
layerName
;
private
Boolean
lowElectricianCert
;
private
String
memo
;
private
Integer
priority
;
//
private Integer priority;
private
String
skill
;
private
String
skillCategory
;
private
String
skillCode
;
private
String
skillGroupCode
;
private
String
skillGroupName
;
private
Integer
takeEngineer
;
private
Integer
takeTime
;
private
String
type
;
...
...
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomizeEntity.java
0 → 100644
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.util.Date
;
@Entity
@Data
@Table
(
name
=
"map_layer_customize_entity"
)
public
class
MapLayerCustomizeEntity
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
id
;
@Column
(
name
=
"branch_id"
,
nullable
=
false
,
length
=
32
)
private
String
branchId
;
@Column
(
name
=
"layer_id"
,
length
=
32
)
private
String
layerId
;
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
private
String
layer
;
@Column
(
name
=
"layer_describe"
,
nullable
=
false
,
length
=
200
)
private
String
layerDescribe
;
@Column
(
name
=
"disabled"
,
nullable
=
false
)
private
boolean
disabled
;
@Column
(
name
=
"memo"
,
nullable
=
false
,
length
=
100
)
private
String
memo
;
@Column
(
name
=
"create_time"
,
nullable
=
false
)
private
Date
createTime
;
@Column
(
name
=
"update_time"
,
nullable
=
false
)
private
Date
updateTime
;
// Getters and Setters
// ...
}
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerEntity.java
0 → 100644
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.util.Date
;
@Entity
@Data
@Table
(
name
=
"map_layer"
)
public
class
MapLayerEntity
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
id
;
@Column
(
name
=
"layer_id"
,
nullable
=
false
,
length
=
32
)
private
String
layerId
;
@Column
(
name
=
"layer"
,
nullable
=
false
,
length
=
50
)
private
String
layer
;
@Column
(
name
=
"layer_describe"
,
nullable
=
false
,
length
=
200
)
private
String
layerDescribe
;
@Column
(
name
=
"memo"
,
nullable
=
false
,
length
=
100
)
private
String
memo
;
@Column
(
name
=
"create_time"
,
nullable
=
false
)
private
Date
createTime
;
@Column
(
name
=
"update_time"
,
nullable
=
false
)
private
Date
updateTime
;
// Getters and Setters
// ...
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBaseServiceImpl.java
View file @
10c06d1
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dao.MapLayerCustomizeDao
;
import
com.dituhui.pea.order.dao.MapLayerDao
;
import
com.dituhui.pea.order.dao.SkillGroupDao
;
import
com.dituhui.pea.order.dao.SkillInfoDao
;
import
com.dituhui.pea.order.dto.BusinessSkillListDTO
;
import
com.dituhui.pea.order.entity.MapLayerCustomizeEntity
;
import
com.dituhui.pea.order.entity.MapLayerEntity
;
import
com.dituhui.pea.order.entity.SkillGroupEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.service.BusinessBaseService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -12,7 +18,9 @@ import org.springframework.data.domain.PageRequest;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -22,12 +30,25 @@ public class BusinessBaseServiceImpl implements BusinessBaseService {
@Autowired
private
SkillInfoDao
skillInfoDao
;
@Autowired
private
MapLayerDao
mapLayerDao
;
@Autowired
private
MapLayerCustomizeDao
mapLayerCustomizeDao
;
@Autowired
private
SkillGroupDao
skillGroupDao
;
private
Map
<
String
,
String
>
mapLayer
=
null
;
private
Map
<
String
,
String
>
mapSkillGroup
=
null
;
@Override
public
Result
<?>
getSkillList
(
BusinessSkillListDTO
.
Request
req
)
{
Pageable
pageable
=
PageRequest
.
of
(
req
.
getPage
()
-
1
,
req
.
getSize
());
Page
<
SkillInfoEntity
>
page
=
skillInfoDao
.
findAll
(
pageable
);
List
<
BusinessSkillListDTO
.
Content
>
contents
=
page
.
getContent
().
stream
().
map
(
e
->
{
List
<
BusinessSkillListDTO
.
Content
>
contents
=
page
.
getContent
().
stream
().
map
(
e
->
{
return
new
BusinessSkillListDTO
.
Content
()
.
setSkillCode
(
e
.
getSkillCode
())
.
setBrand
(
e
.
getBrand
())
...
...
@@ -37,9 +58,11 @@ public class BusinessBaseServiceImpl implements BusinessBaseService {
.
setTakeEngineer
(
e
.
getTakeEngineer
())
.
setLowElectricianCert
(
e
.
getLowElectricianCert
())
.
setGasCert
(
e
.
getGasCert
())
.
setPriority
(
e
.
getPriority
())
//
.setPriority(e.getPriority())
.
setSkillGroupCode
(
e
.
getSkillGroupCode
())
.
setSkillGroupName
(
this
.
getSkillGroupName
(
e
.
getSkillCode
()))
.
setLayerId
(
e
.
getLayerId
())
.
setLayerName
(
this
.
getLayerName
(
e
.
getLayerId
()))
.
setTypeCategory
(
e
.
getTypeCategory
())
.
setSkillCategory
(
e
.
getSkillCategory
())
.
setMemo
(
e
.
getMemo
())
...
...
@@ -54,4 +77,29 @@ public class BusinessBaseServiceImpl implements BusinessBaseService {
rs
.
setContent
(
contents
);
return
Result
.
success
(
rs
);
}
private
void
initMaps
()
{
// 图层
mapLayer
=
new
HashMap
<>();
mapLayer
.
putAll
(
mapLayerDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
MapLayerEntity:
:
getLayerId
,
MapLayerEntity:
:
getLayer
)));
mapLayer
.
putAll
(
mapLayerCustomizeDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
MapLayerCustomizeEntity:
:
getLayerId
,
MapLayerCustomizeEntity:
:
getLayer
)));
// 技能组
mapSkillGroup
=
new
HashMap
<>();
mapSkillGroup
.
putAll
(
skillGroupDao
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
SkillGroupEntity:
:
getSkillGroupCode
,
SkillGroupEntity:
:
getSkillGroup
)));
}
String
getLayerName
(
String
layerId
)
{
if
(
mapLayer
==
null
)
{
initMaps
();
}
return
mapLayer
.
get
(
layerId
);
}
String
getSkillGroupName
(
String
skillGroupCode
)
{
if
(
mapSkillGroup
==
null
)
{
initMaps
();
;
}
return
mapSkillGroup
.
get
(
skillGroupCode
);
}
}
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