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 d973aa7e
authored
Nov 14, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
2 parents
88ff1569
5380e78c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
project-order/src/main/java/com/dituhui/pea/order/entity/OrgBranchEntity.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/entity/OrgBranchEntity.java
View file @
d973aa7
...
...
@@ -44,6 +44,12 @@ public class OrgBranchEntity {
private
String
memo
;
/**
* 容量类型,0:返回所有类型 1:只返全天, 2:返全天/半天
*/
@Column
(
name
=
"capacity_type"
,
nullable
=
false
)
private
Integer
capacityType
=
0
;
private
LocalDateTime
createTime
=
LocalDateTime
.
now
();
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
View file @
d973aa7
...
...
@@ -15,6 +15,7 @@ import com.dituhui.pea.order.dao.EngineerInfoDao;
import
com.dituhui.pea.order.dao.EngineerSkillDao
;
import
com.dituhui.pea.order.dao.EngineerSliceUsedCapacityDao
;
import
com.dituhui.pea.order.dao.MapBlockInfoDao
;
import
com.dituhui.pea.order.dao.OrgBranchDao
;
import
com.dituhui.pea.order.dao.OrgTeamDao
;
import
com.dituhui.pea.order.dao.SkillInfoDao
;
import
com.dituhui.pea.order.dao.TimeSliceDao
;
...
...
@@ -26,6 +27,7 @@ import com.dituhui.pea.order.entity.CapacityEngineerStatEntity;
import
com.dituhui.pea.order.entity.EngineerInfoEntity
;
import
com.dituhui.pea.order.entity.EngineerSkillEntity
;
import
com.dituhui.pea.order.entity.MapBlockInfoEntity
;
import
com.dituhui.pea.order.entity.OrgBranchEntity
;
import
com.dituhui.pea.order.entity.OrgTeamEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.entity.TimeSliceEntity
;
...
...
@@ -83,6 +85,8 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
@Autowired
private
OrgTeamDao
orgTeamDao
;
@Autowired
private
OrgBranchDao
orgBranchDao
;
@Autowired
ISaaSRemoteService
saasRemoteService
;
@Autowired
...
...
@@ -125,7 +129,10 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.
collect
(
Collectors
.
toList
());
List
<
String
>
groupList
=
mapBlockInBlockIdsList
.
stream
().
map
(
MapBlockInfoEntity:
:
getGroupId
).
distinct
()
.
collect
(
Collectors
.
toList
());
List
<
String
>
branchList
=
mapBlockInBlockIdsList
.
stream
().
map
(
MapBlockInfoEntity:
:
getBranchId
).
distinct
()
.
collect
(
Collectors
.
toList
());
final
String
teamId
=
teamIdList
.
get
(
0
);
final
String
branchId
=
branchList
.
get
(
0
);
//3. 查询分站下拥有对应技能的工程师(排重) 技能码转换为对应的技能汉字
List
<
SkillInfoEntity
>
querySkillGroup
=
new
ArrayList
<>();
...
...
@@ -134,9 +141,11 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
//查询对应的技能信息
SkillInfoEntity
skillInfo
=
skillInfoDao
.
getByBrandAndTypeAndSkill
(
service
.
getBrand
(),
service
.
getProductType
(),
service
.
getServiceType
());
if
(
Objects
.
nonNull
(
skillInfo
))
{
skillGroupCodes
.
add
(
skillInfo
.
getSkillGroupCode
());
querySkillGroup
.
add
(
skillInfo
);
}
}
if
(
CollectionUtils
.
isEmpty
(
querySkillGroup
))
{
throw
new
BusinessException
(
"查询不到对应的技能组信息"
);
...
...
@@ -153,10 +162,17 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.
mapToInt
(
SkillInfoEntity:
:
getTakeTime
)
.
sum
();
//查询单个工程师日期范围内的技能容量信息 后加和汇总
CopyOnWriteArrayList
<
TimeSliceEntity
>
halfDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
timeSliceDao
.
findByType
(
"HALF_DAY"
)
);
OrgBranchEntity
branchInfo
=
orgBranchDao
.
getByBranchId
(
branchId
);
CopyOnWriteArrayList
<
TimeSliceEntity
>
allDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
timeSliceDao
.
findByType
(
"ALL_DAY"
));
CopyOnWriteArrayList
<
TimeSliceEntity
>
halfDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>();
if
(
branchInfo
.
getCapacityType
()
==
0
||
branchInfo
.
getCapacityType
()
==
2
)
{
halfDayTypeTimeSlice
.
addAll
(
timeSliceDao
.
findByType
(
"HALF_DAY"
));
}
CopyOnWriteArrayList
<
TimeSliceEntity
>
timeSliceEntities
=
new
CopyOnWriteArrayList
<>();
if
(
branchInfo
.
getCapacityType
()
==
0
)
{
timeSliceEntities
.
addAll
(
getTimeSliceEntities
(
teamId
));
}
CopyOnWriteArrayList
<
TimeSliceEntity
>
timeSliceEntities
=
getTimeSliceEntities
(
teamId
);
//定义返回值
CapacityQueryDTO
.
Result
result
=
new
CapacityQueryDTO
.
Result
();
result
.
setGroupId
(
groupList
.
get
(
0
));
...
...
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