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 130561b8
authored
Jul 17, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
甘特图中的订单,增加了caption字段,用于返回技能类型;使用了SpringDataJPA的投影(Projection)功能实现
1 parent
e5106a1d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
13 deletions
.gitignore
project-order/src/main/java/com/dituhui/pea/order/dao/OrderRequestDao.java
project-order/src/main/java/com/dituhui/pea/order/dao/OrderSkillProjection.java
project-order/src/main/java/com/dituhui/pea/order/dto/EngineersGanttDTO.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
.gitignore
View file @
130561b
...
@@ -9,4 +9,5 @@
...
@@ -9,4 +9,5 @@
/*/.project
/*/.project
/*/logs/
/*/logs/
/*/.gitignore
/*/.gitignore
dispatchSolution-*.json
dispatchSolution-*.json
\ No newline at end of file
/project-order/src/main/resources/application-dev.yaml
project-order/src/main/java/com/dituhui/pea/order/dao/OrderRequestDao.java
View file @
130561b
...
@@ -2,14 +2,21 @@ package com.dituhui.pea.order.dao;
...
@@ -2,14 +2,21 @@ package com.dituhui.pea.order.dao;
import
com.dituhui.pea.order.entity.OrderRequestEntity
;
import
com.dituhui.pea.order.entity.OrderRequestEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
@Repository
@Repository
public
interface
OrderRequestDao
extends
JpaRepository
<
OrderRequestEntity
,
Long
>
{
public
interface
OrderRequestDao
extends
JpaRepository
<
OrderRequestEntity
,
Long
>
{
OrderRequestEntity
getByOrderId
(
String
orderId
);
OrderRequestEntity
getByOrderId
(
String
orderId
);
List
<
OrderRequestEntity
>
findAllByOrderIdIn
(
List
<
String
>
orderIds
);
List
<
OrderRequestEntity
>
findAllByOrderIdIn
(
List
<
String
>
orderIds
);
@Query
(
"SELECT o.orderId, s.skillCategory as skillCaption FROM OrderRequestEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId"
)
OrderSkillProjection
getOrderSkillCaptionByOrderId
(
@Param
(
"orderId"
)
String
orderId
);
}
}
project-order/src/main/java/com/dituhui/pea/order/dao/OrderSkillProjection.java
0 → 100644
View file @
130561b
package
com
.
dituhui
.
pea
.
order
.
dao
;
public
interface
OrderSkillProjection
{
String
getOrderId
();
String
getSkillCaption
();
}
project-order/src/main/java/com/dituhui/pea/order/dto/EngineersGanttDTO.java
View file @
130561b
...
@@ -80,6 +80,8 @@ public class EngineersGanttDTO {
...
@@ -80,6 +80,8 @@ public class EngineersGanttDTO {
* 工单ID
* 工单ID
*/
*/
private
String
orderId
;
private
String
orderId
;
private
String
caption
;
/**
/**
* 排班状态
* 排班状态
*/
*/
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/CapacityQueryServiceImpl.java
View file @
130561b
...
@@ -117,7 +117,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
...
@@ -117,7 +117,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
OrgTeamEntity
orgTeamEntity
=
orgTeamDao
.
getByTeamId
(
teamId
);
OrgTeamEntity
orgTeamEntity
=
orgTeamDao
.
getByTeamId
(
teamId
);
SpanInfo
r
=
new
SpanInfo
();
SpanInfo
r
=
new
SpanInfo
();
if
(
"全天"
.
equals
(
timeSpan
))
{
if
(
"全天"
.
equals
(
timeSpan
))
{
r
.
setTitle
(
"全天
都可以
"
);
r
.
setTitle
(
"全天"
);
r
.
setTimeBegin
(
String
.
format
(
"%s %s:00"
,
date
,
orgTeamEntity
.
getWorkOn
()));
r
.
setTimeBegin
(
String
.
format
(
"%s %s:00"
,
date
,
orgTeamEntity
.
getWorkOn
()));
r
.
setTimeEnd
(
String
.
format
(
"%s %s:00"
,
date
,
orgTeamEntity
.
getWorkOff
()));
r
.
setTimeEnd
(
String
.
format
(
"%s %s:00"
,
date
,
orgTeamEntity
.
getWorkOff
()));
}
else
{
}
else
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
View file @
130561b
...
@@ -2,16 +2,10 @@ package com.dituhui.pea.order.service.impl;
...
@@ -2,16 +2,10 @@ package com.dituhui.pea.order.service.impl;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.common.EngineerUtils
;
import
com.dituhui.pea.order.common.EngineerUtils
;
import
com.dituhui.pea.order.dao.CapacityEngineerStatDao
;
import
com.dituhui.pea.order.dao.*
;
import
com.dituhui.pea.order.dao.EngineerInfoDao
;
import
com.dituhui.pea.order.dao.OrderAppointmentDao
;
import
com.dituhui.pea.order.dao.OrderRequestDao
;
import
com.dituhui.pea.order.dto.EngineersGanttDTO
;
import
com.dituhui.pea.order.dto.EngineersGanttDTO
;
import
com.dituhui.pea.order.dto.LabelValueDTO
;
import
com.dituhui.pea.order.dto.LabelValueDTO
;
import
com.dituhui.pea.order.entity.CapacityEngineerStatEntity
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.entity.EngineerInfoEntity
;
import
com.dituhui.pea.order.entity.OrderAppointmentEntity
;
import
com.dituhui.pea.order.entity.OrderRequestEntity
;
import
com.dituhui.pea.order.service.EngineerGanttService
;
import
com.dituhui.pea.order.service.EngineerGanttService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -63,6 +57,11 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
...
@@ -63,6 +57,11 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
order
.
setStartTime
(
e
.
getExpectStartTime
()).
setEndTime
(
e
.
getExpectEndTime
());
order
.
setStartTime
(
e
.
getExpectStartTime
()).
setEndTime
(
e
.
getExpectEndTime
());
order
.
setOrderId
(
e
.
getOrderId
()).
setPreStatus
(
e
.
getPreStatus
());
order
.
setOrderId
(
e
.
getOrderId
()).
setPreStatus
(
e
.
getPreStatus
());
order
.
setTips
(
getOrderTips
(
e
.
getOrderId
()));
order
.
setTips
(
getOrderTips
(
e
.
getOrderId
()));
OrderSkillProjection
orderSkill
=
orderRequestDao
.
getOrderSkillCaptionByOrderId
(
e
.
getOrderId
());
if
(
orderSkill
!=
null
)
{
order
.
setCaption
(
orderSkill
.
getSkillCaption
());
}
order
.
setAppointmentStatus
(
mapOrderRequest
.
get
(
e
.
getOrderId
()).
getAppointmentStatus
());
order
.
setAppointmentStatus
(
mapOrderRequest
.
get
(
e
.
getOrderId
()).
getAppointmentStatus
());
List
<
EngineersGanttDTO
.
Order
>
orders
=
null
;
List
<
EngineersGanttDTO
.
Order
>
orders
=
null
;
if
(
mapEngineers
.
containsKey
(
e
.
getEngineerCode
()))
{
if
(
mapEngineers
.
containsKey
(
e
.
getEngineerCode
()))
{
...
@@ -156,5 +155,4 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
...
@@ -156,5 +155,4 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"标签"
).
setValue
(
order
.
getTags
()));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"标签"
).
setValue
(
order
.
getTags
()));
return
tips
;
return
tips
;
}
}
}
}
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