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 d4c3e888
authored
Jul 14, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-dingwf-0715' into develop
2 parents
a2fe7924
bfa0d97c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
27 deletions
project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTreeRespDTO.java → project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTreeDTO.java
project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTreeReqDTO.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTree
Resp
DTO.java
→
project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTreeDTO.java
View file @
d4c3e88
package
com
.
dituhui
.
pea
.
order
.
dto
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
@lombok
.
Data
@Accessors
(
chain
=
true
)
public
class
OrganizationTreeRespDTO
{
public
class
OrganizationTreeDTO
{
@Data
public
static
class
Request
{
private
String
levelType
;
private
String
levelValue
;
}
@lombok
.
Data
@Accessors
(
chain
=
true
)
public
static
class
Result
{
private
String
levelType
;
private
String
levelValue
;
private
List
<?>
clusters
;
}
@lombok
.
Data
@Accessors
(
chain
=
true
)
...
...
@@ -74,4 +88,3 @@ public class OrganizationTreeRespDTO {
private
String
type
;
}
}
project-order/src/main/java/com/dituhui/pea/order/dto/OrganizationTreeReqDTO.java
deleted
100644 → 0
View file @
a2fe792
package
com
.
dituhui
.
pea
.
order
.
dto
;
@lombok
.
Data
public
class
OrganizationTreeReqDTO
{
private
String
levelType
;
private
String
levelValue
;
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
View file @
d4c3e88
...
...
@@ -57,7 +57,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
Map
<
String
,
OrderRequestEntity
>
mapOrderRequest
=
getOrdersByOrderIds
(
orderIds
);
HashMap
<
String
,
List
<
EngineersGanttDTO
.
Order
>>
mapEngineers
=
new
HashMap
<>();
for
(
OrderAppointmentEntity
e
:
orderAppointments
)
{
log
.
info
(
"===== order_id: [{}]"
,
e
.
getOrderId
());
//
log.info("===== order_id: [{}]", e.getOrderId());
EngineersGanttDTO
.
Order
order
=
new
EngineersGanttDTO
.
Order
();
// todo 需要根据订单时间和状态,采用expectXXXX或者actualXXXX
order
.
setStartTime
(
e
.
getExpectStartTime
()).
setEndTime
(
e
.
getExpectEndTime
());
...
...
@@ -89,7 +89,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
if
(
capacityEngineerStat
==
null
)
{
log
.
warn
(
"技术员当日的容量数据不存在,{}{}"
,
engineerCode
,
reqDTO
.
getDate
());
}
else
{
log
.
info
(
"====== {}
==== {} "
,
capacityEngineerStat
.
getCapTotal
(),
capacityEngineerStat
.
getCapUsed
()
);
log
.
info
(
"====== {}
"
,
capacityEngineerStat
);
engineer
.
setCapTotal
(
capacityEngineerStat
.
getCapTotal
().
toString
()).
setCapUsed
(
capacityEngineerStat
.
getCapUsed
().
toString
());
}
if
(
mapEngineers
.
containsKey
(
engineerCode
))
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
View file @
d4c3e88
...
...
@@ -31,13 +31,14 @@ public class OrganizationServiceImpl implements OrganizationService {
private
EngineerInfoDao
engineerInfoDao
;
@Autowired
private
OrgTeamDao
orgTeamDao
;
@Autowired
private
EngineerUtils
engineerUtils
;
@Override
public
Result
<?>
getOrganizationTree
(
String
levelType
,
String
levelValue
)
{
// 如果传递了精确的id,只返回对应的tree内容;如果没有传递,返回所有tree内容
OrganizationTreeDTO
.
Result
rs
=
new
OrganizationTreeDTO
.
Result
();
rs
.
setLevelType
(
levelType
).
setLevelValue
(
levelValue
);
if
(
"group"
.
equals
(
levelType
))
{
OrgGroupEntity
orgGroupEntity
=
orgGroupDao
.
getByGroupId
(
levelValue
);
if
(
orgGroupEntity
==
null
)
{
...
...
@@ -48,7 +49,7 @@ public class OrganizationServiceImpl implements OrganizationService {
List
<?>
branchs
=
new
ArrayList
<>(
Collections
.
singletonList
(
branchEntityh2Dto
(
orgBranchEntity
).
setChildren
(
groups
)));
OrgClusterEntity
orgClusterEntity
=
orgClusterDao
.
getByClusterId
(
orgGroupEntity
.
getClusterId
());
List
<?>
clusters
=
new
ArrayList
<>(
Collections
.
singletonList
(
clusterEntity2Dto
(
orgClusterEntity
).
setChildren
(
branchs
)));
r
eturn
Result
.
success
(
new
OrganizationTreeRespDTO
().
setClusters
(
clusters
)
);
r
s
.
setClusters
(
clusters
);
}
else
if
(
"branch"
.
equals
(
levelType
))
{
OrgBranchEntity
orgBranchEntity
=
orgBranchDao
.
getByBranchId
(
levelValue
);
if
(
orgBranchEntity
==
null
)
{
...
...
@@ -58,7 +59,7 @@ public class OrganizationServiceImpl implements OrganizationService {
List
<?>
groups
=
getChildByBranch
(
levelValue
);
List
<?>
branchs
=
new
ArrayList
<>(
Collections
.
singletonList
(
branchEntityh2Dto
(
orgBranchEntity
).
setChildren
(
groups
)));
List
<?>
clusters
=
new
ArrayList
<>(
Collections
.
singletonList
(
clusterEntity2Dto
(
orgClusterEntity
).
setChildren
(
branchs
)));
r
eturn
Result
.
success
(
new
OrganizationTreeRespDTO
().
setClusters
(
clusters
)
);
r
s
.
setClusters
(
clusters
);
}
else
if
(
"cluster"
.
equals
(
levelType
))
{
OrgClusterEntity
orgClusterEntity
=
orgClusterDao
.
getByClusterId
(
levelValue
);
if
(
orgClusterEntity
==
null
)
{
...
...
@@ -66,10 +67,11 @@ public class OrganizationServiceImpl implements OrganizationService {
}
List
<?>
branchs
=
getChildByCluster
(
levelValue
);
List
<?>
clusters
=
new
ArrayList
<>(
Collections
.
singletonList
(
clusterEntity2Dto
(
orgClusterEntity
).
setChildren
(
branchs
)));
r
eturn
Result
.
success
(
new
OrganizationTreeRespDTO
().
setClusters
(
clusters
)
);
r
s
.
setClusters
(
clusters
);
}
else
{
r
eturn
Result
.
success
(
new
OrganizationTreeRespDTO
().
setClusters
(
getTreeByRoot
()
));
r
s
.
setClusters
(
getTreeByRoot
(
));
}
return
Result
.
success
(
rs
);
}
@Override
...
...
@@ -128,7 +130,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
private
List
<?>
getTreeByRoot
()
{
List
<
OrganizationTree
Resp
DTO
.
Cluster
>
clusters
=
new
ArrayList
<>();
List
<
OrganizationTreeDTO
.
Cluster
>
clusters
=
new
ArrayList
<>();
for
(
OrgClusterEntity
c
:
orgClusterDao
.
findAll
())
{
clusters
.
add
(
clusterEntity2Dto
(
c
).
setChildren
(
getChildByCluster
(
c
.
getClusterId
())));
}
...
...
@@ -136,7 +138,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
private
List
<?>
getChildByCluster
(
String
clusterId
)
{
List
<
OrganizationTree
Resp
DTO
.
Branch
>
branches
=
new
ArrayList
<>();
List
<
OrganizationTreeDTO
.
Branch
>
branches
=
new
ArrayList
<>();
for
(
OrgBranchEntity
b
:
orgBranchDao
.
findAllByClusterId
(
clusterId
))
{
branches
.
add
(
branchEntityh2Dto
(
b
).
setChildren
(
getChildByBranch
(
b
.
getBranchId
())));
}
...
...
@@ -145,30 +147,29 @@ public class OrganizationServiceImpl implements OrganizationService {
private
List
<?>
getChildByBranch
(
String
branchId
)
{
// 获取branch及下面的group
List
<
OrganizationTree
Resp
DTO
.
Group
>
groups
=
new
ArrayList
<>();
List
<
OrganizationTreeDTO
.
Group
>
groups
=
new
ArrayList
<>();
for
(
OrgGroupEntity
g
:
orgGroupDao
.
findAllByBranchId
(
branchId
))
{
groups
.
add
(
groupEntity2Dto
(
g
));
}
return
groups
;
}
private
OrganizationTreeRespDTO
.
Group
groupEntity2Dto
(
OrgGroupEntity
orgGroupEntity
)
{
return
new
OrganizationTreeRespDTO
.
Group
()
private
OrganizationTreeDTO
.
Group
groupEntity2Dto
(
OrgGroupEntity
orgGroupEntity
)
{
return
new
OrganizationTreeDTO
.
Group
()
.
setType
(
"group"
)
.
setId
(
orgGroupEntity
.
getGroupId
())
.
setTitle
(
orgGroupEntity
.
getGroupName
());
}
private
OrganizationTree
Resp
DTO
.
Branch
branchEntityh2Dto
(
OrgBranchEntity
orgBranchEntity
)
{
return
new
OrganizationTree
Resp
DTO
.
Branch
()
private
OrganizationTreeDTO
.
Branch
branchEntityh2Dto
(
OrgBranchEntity
orgBranchEntity
)
{
return
new
OrganizationTreeDTO
.
Branch
()
.
setType
(
"branch"
)
.
setId
(
orgBranchEntity
.
getBranchId
())
.
setTitle
(
orgBranchEntity
.
getBranchName
());
}
private
OrganizationTree
Resp
DTO
.
Cluster
clusterEntity2Dto
(
OrgClusterEntity
orgClusterEntity
)
{
return
new
OrganizationTree
Resp
DTO
.
Cluster
()
private
OrganizationTreeDTO
.
Cluster
clusterEntity2Dto
(
OrgClusterEntity
orgClusterEntity
)
{
return
new
OrganizationTreeDTO
.
Cluster
()
.
setType
(
"cluster"
)
.
setId
(
orgClusterEntity
.
getClusterId
())
.
setTitle
(
orgClusterEntity
.
getName
());
...
...
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