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