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 8ddbdcbe
authored
Nov 03, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(平台内改约容量接口分区匹配功能): 更改sass 匹配区划功能实现
1 parent
b57d5895
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
project-order/src/main/java/com/dituhui/pea/order/dao/MapBlockInfoDao.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/common/CapacityUtils.java
View file @
8ddbdcb
...
...
@@ -4,7 +4,6 @@ import com.dituhui.pea.order.common.jackson.DateUtil;
import
com.dituhui.pea.order.dao.MapBlockInfoDao
;
import
com.dituhui.pea.order.dao.SkillInfoDao
;
import
com.dituhui.pea.order.dto.param.CapacityQueryDTO
;
import
com.dituhui.pea.order.entity.CapacityEngineerCalendarEntity
;
import
com.dituhui.pea.order.entity.CapacityEngineerSliceUsedEntity
;
import
com.dituhui.pea.order.entity.MapBlockInfoEntity
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
...
...
@@ -24,10 +23,12 @@ import java.util.ArrayList;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ForkJoinPool
;
import
java.util.concurrent.ForkJoinTask
;
...
...
@@ -45,7 +46,14 @@ public class CapacityUtils {
private
MapBlockInfoDao
mapBlockInfoDao
;
public
List
<
String
>
getTeamIdsByBlockIdsAndLayerIds
(
List
<
String
>
blockIds
,
List
<
String
>
layerIds
)
{
List
<
String
>
teamIds
=
mapBlockInfoDao
.
findByAreaIdsInAndLayerIdIn
(
blockIds
,
layerIds
).
stream
().
map
(
MapBlockInfoEntity:
:
getTeamId
).
collect
(
Collectors
.
toList
());
Set
<
MapBlockInfoEntity
>
mapBlockInBlockIdsList
=
new
HashSet
<>();
//区划所在范围所有工作队
for
(
String
blockId
:
blockIds
)
{
List
<
MapBlockInfoEntity
>
mapBlockInfoEntities
=
mapBlockInfoDao
.
findByAreaIdsLikeAndLayerIdIn
(
"%"
+
blockId
+
"%"
,
layerIds
);
mapBlockInBlockIdsList
.
addAll
(
mapBlockInfoEntities
);
}
List
<
String
>
teamIds
=
mapBlockInBlockIdsList
.
stream
().
map
(
MapBlockInfoEntity:
:
getTeamId
).
collect
(
Collectors
.
toList
());
log
.
info
(
"根据输入信息返回对应的可能的工作队列表({}/{}) ===> {}"
,
blockIds
,
layerIds
,
teamIds
);
return
teamIds
;
}
...
...
project-order/src/main/java/com/dituhui/pea/order/dao/MapBlockInfoDao.java
View file @
8ddbdcb
...
...
@@ -12,7 +12,7 @@ import java.util.List;
@Repository
public
interface
MapBlockInfoDao
extends
JpaRepository
<
MapBlockInfoEntity
,
Integer
>,
JpaSpecificationExecutor
<
MapBlockInfoEntity
>
{
List
<
MapBlockInfoEntity
>
findByAreaIds
InAndLayerIdIn
(
List
<
String
>
blockIds
,
List
<
String
>
layerIds
);
List
<
MapBlockInfoEntity
>
findByAreaIds
LikeAndLayerIdIn
(
String
blockId
,
List
<
String
>
layerIds
);
MapBlockInfoEntity
findByAreaIds
(
String
blockId
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
View file @
8ddbdcb
...
...
@@ -145,8 +145,8 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.
mapToInt
(
SkillInfoEntity:
:
getTakeTime
)
.
sum
();
//查询单个工程师日期范围内的技能容量信息 后加和汇总
CopyOnWriteArrayList
<
TimeSliceEntity
>
halfDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
);
//
timeSliceDao.findByType("HALF_DAY"));
CopyOnWriteArrayList
<
TimeSliceEntity
>
allDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
);
//
timeSliceDao.findByType("ALL_DAY"));
CopyOnWriteArrayList
<
TimeSliceEntity
>
halfDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
timeSliceDao
.
findByType
(
"HALF_DAY"
));
CopyOnWriteArrayList
<
TimeSliceEntity
>
allDayTypeTimeSlice
=
new
CopyOnWriteArrayList
<>(
timeSliceDao
.
findByType
(
"ALL_DAY"
));
CopyOnWriteArrayList
<
TimeSliceEntity
>
timeSliceEntities
=
new
CopyOnWriteArrayList
<>(
sliceTime
(
LocalDate
.
now
(),
LocalTime
.
of
(
8
,
0
),
LocalTime
.
of
(
18
,
0
)));
...
...
@@ -271,7 +271,14 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
// 同步到saas,返回blockId
List
<
String
>
blockIds
=
null
;
if
(
StringUtils
.
isNotBlank
(
reqDTO
.
getLocation
()))
{
blockIds
=
saasUtils
.
queryBlocksByLocation
(
reqDTO
.
getLocation
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
FendanDTO
fendanDTO
=
new
FendanDTO
();
fendanDTO
.
setXy
(
reqDTO
.
getLocation
());
List
<
SaasUtils
.
BlockInfo
>
blockInfoList
=
saasUtils
.
queryBlocksByXy
(
fendanDTO
);
if
(
blockInfoList
.
isEmpty
())
{
return
Result
.
failed
(
StatusCodeEnum
.
FENDAN_AREA_UNMATCHED
);
}
//2:根据查询出区划匹配分站信息
blockIds
=
blockInfoList
.
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
distinct
().
collect
(
Collectors
.
toList
());
}
else
{
blockIds
=
saasUtils
.
queryBlocksByAddress
(
reqDTO
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
...
...
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