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 b78b3d3c
authored
Jul 12, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://zhangguoping@gitlab.dituhui.com/bsh/project/pr…
…oject.git into develop
2 parents
b3353794
5cc66198
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
295 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/BusinessController.java
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/dao/SkillInfoDao.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/BusinessBaseService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBaseServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/BusinessController.java
View file @
b78b3d3
...
@@ -3,6 +3,7 @@ package com.dituhui.pea.order.controller;
...
@@ -3,6 +3,7 @@ package com.dituhui.pea.order.controller;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.*
;
import
com.dituhui.pea.order.dto.*
;
import
com.dituhui.pea.order.service.BusinessBaseService
;
import
com.dituhui.pea.order.service.BusinessTeamService
;
import
com.dituhui.pea.order.service.BusinessTeamService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -15,6 +16,9 @@ public class BusinessController {
...
@@ -15,6 +16,9 @@ public class BusinessController {
@Autowired
@Autowired
private
BusinessTeamService
businessTeamService
;
private
BusinessTeamService
businessTeamService
;
@Autowired
private
BusinessBaseService
businessBaseService
;
@GetMapping
(
"/business/team/list"
)
@GetMapping
(
"/business/team/list"
)
public
Result
<?>
getTeamList
(
@Validated
BusinessTeamsDTO
.
Request
reqDTO
)
{
public
Result
<?>
getTeamList
(
@Validated
BusinessTeamsDTO
.
Request
reqDTO
)
{
Result
<?>
res
=
null
;
Result
<?>
res
=
null
;
...
@@ -102,4 +106,15 @@ public class BusinessController {
...
@@ -102,4 +106,15 @@ public class BusinessController {
}
}
return
res
;
return
res
;
}
}
@GetMapping
(
"/business/skill/list"
)
public
Result
<?>
getSkillList
(
@Validated
BusinessSkillListDTO
.
Request
reqDTO
)
{
Result
<?>
res
=
null
;
try
{
res
=
businessBaseService
.
getSkillList
(
reqDTO
);
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
}
}
project-order/src/main/java/com/dituhui/pea/order/dao/MapLayerCustomizeDao.java
0 → 100644
View file @
b78b3d3
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 @
b78b3d3
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 @
b78b3d3
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/dao/SkillInfoDao.java
View file @
b78b3d3
package
com
.
dituhui
.
pea
.
order
.
dao
;
package
com
.
dituhui
.
pea
.
order
.
dao
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
import
java.util.List
;
public
interface
SkillInfoDao
extends
JpaRepository
<
SkillInfoEntity
,
Long
>
{
public
interface
SkillInfoDao
extends
JpaRepository
<
SkillInfoEntity
,
Long
>
{
List
<
SkillInfoEntity
>
findAll
();
List
<
SkillInfoEntity
>
findAll
();
Page
<
SkillInfoEntity
>
findAll
(
Pageable
pageable
);
}
}
project-order/src/main/java/com/dituhui/pea/order/dto/BusinessSkillListDTO.java
0 → 100644
View file @
b78b3d3
package
com
.
dituhui
.
pea
.
order
.
dto
;
import
lombok.experimental.Accessors
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
static
com
.
dituhui
.
pea
.
order
.
config
.
OrderConfig
.
DEFAULT_PAGE_SIZE
;
public
class
BusinessSkillListDTO
{
@lombok
.
Data
public
static
class
Request
{
private
Integer
size
=
DEFAULT_PAGE_SIZE
;
private
Integer
page
=
1
;
/**
* 服务分类,可选
*/
private
String
skillCategory
;
/**
* 产品分类,可选
*/
private
String
typeCategory
;
}
@lombok
.
Data
@Accessors
(
chain
=
true
)
public
static
class
Result
{
private
List
<
Content
>
content
;
private
long
pageCurrent
;
private
long
pages
;
private
long
pageSize
;
private
long
total
;
}
@lombok
.
Data
@Accessors
(
chain
=
true
)
public
static
class
Content
{
private
String
brand
;
private
LocalDateTime
createTime
;
private
Boolean
gasCert
;
private
String
layerId
;
private
String
layerName
;
private
Boolean
lowElectricianCert
;
private
String
memo
;
// 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
;
private
String
typeCategory
;
private
LocalDateTime
updateTime
;
}
}
project-order/src/main/java/com/dituhui/pea/order/entity/MapLayerCustomizeEntity.java
0 → 100644
View file @
b78b3d3
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 @
b78b3d3
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/BusinessBaseService.java
0 → 100644
View file @
b78b3d3
package
com
.
dituhui
.
pea
.
order
.
service
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.BusinessSkillListDTO
;
public
interface
BusinessBaseService
{
Result
<?>
getSkillList
(
BusinessSkillListDTO
.
Request
req
);
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessBaseServiceImpl.java
0 → 100644
View file @
b78b3d3
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
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
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
@Slf4j
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
->
{
return
new
BusinessSkillListDTO
.
Content
()
.
setSkillCode
(
e
.
getSkillCode
())
.
setBrand
(
e
.
getBrand
())
.
setType
(
e
.
getType
())
.
setSkill
(
e
.
getSkill
())
.
setTakeTime
(
e
.
getTakeTime
())
.
setTakeEngineer
(
e
.
getTakeEngineer
())
.
setLowElectricianCert
(
e
.
getLowElectricianCert
())
.
setGasCert
(
e
.
getGasCert
())
//.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
())
.
setCreateTime
(
e
.
getCreateTime
())
.
setUpdateTime
(
e
.
getUpdateTime
());
}).
collect
(
Collectors
.
toList
());
BusinessSkillListDTO
.
Result
rs
=
new
BusinessSkillListDTO
.
Result
();
rs
.
setTotal
(
page
.
getTotalElements
())
.
setPages
(
page
.
getTotalPages
())
.
setPageSize
(
page
.
getSize
())
.
setPageCurrent
(
page
.
getNumber
());
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