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 c634219c
authored
Jun 14, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
技术员甘特图要素修改
1 parent
7a8fc959
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
23 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/CapacityEngineerStatDao.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/WorkbenchEngineersGanttRespDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/entity/CapacityEngineerStatEntity.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/CapacityEngineerStatDao.java
0 → 100644
View file @
c634219
package
com
.
alibaba
.
cloud
.
integration
.
order
.
dao
;
import
com.alibaba.cloud.integration.order.entity.CapacityEngineerStatEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
CapacityEngineerStatDao
extends
JpaRepository
<
CapacityEngineerStatEntity
,
Integer
>
{
CapacityEngineerStatEntity
getByEngineerCodeAndWorkday
(
String
engineerCode
,
String
workday
);
}
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/WorkbenchEngineersGanttRespDTO.java
View file @
c634219
...
@@ -26,6 +26,10 @@ public class WorkbenchEngineersGanttRespDTO {
...
@@ -26,6 +26,10 @@ public class WorkbenchEngineersGanttRespDTO {
* 工程师工号
* 工程师工号
*/
*/
private
String
engineerCode
;
private
String
engineerCode
;
private
String
engineerName
;
private
String
capTotal
;
private
String
capUsed
;
private
String
grade
;
/**
/**
* 延误原因展示说明
* 延误原因展示说明
*/
*/
...
@@ -38,28 +42,35 @@ public class WorkbenchEngineersGanttRespDTO {
...
@@ -38,28 +42,35 @@ public class WorkbenchEngineersGanttRespDTO {
* 上班时间
* 上班时间
*/
*/
private
String
startTime
;
private
String
startTime
;
private
List
<?>
timeline
;
private
List
<?>
orders
;
}
}
@lombok
.
Data
@lombok
.
Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
public
static
class
Timeline
{
public
static
class
Order
{
/**
/**
*
结束时间
*
工单ID
*/
*/
private
Date
endTime
;
private
String
orderId
;
/**
/**
*
服务单ID
*
工单状态值
*/
*/
private
String
serviceOrderId
;
private
String
orderStatus
;
/**
/**
*
服务单状态值
*
工单状态描述
*/
*/
private
String
serviceOrderStatus
;
private
String
orderStatusDesc
;
/**
/**
* 开始时间
* 开始时间
*/
*/
private
Date
startTime
;
private
Date
startTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
* 鼠标悬停提示
*/
private
List
<?>
tips
;
private
List
<?>
tips
;
}
}
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/entity/CapacityEngineerStatEntity.java
0 → 100644
View file @
c634219
package
com
.
alibaba
.
cloud
.
integration
.
order
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.util.Date
;
@Data
@Entity
@Table
(
name
=
"capacity_engineer_stat"
)
public
class
CapacityEngineerStatEntity
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
/**
* 日期
*/
private
String
workday
;
/**
* 技术员id
*/
private
String
engineerCode
;
/**
* 总容量(分钟)
*/
private
Integer
capTotal
;
/**
* 已占容量
*/
private
Integer
capUsed
;
/**
* 已占容量-路途
*/
private
Integer
capUsedTravel
;
/**
* 剩余可约容量
*/
private
Integer
capLeft
;
/**
* 已约单量
*/
private
Integer
orderCount
;
/**
* 最大连续时长
*/
private
Integer
maxDuration
;
/**
* 备注
*/
private
String
memo
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
View file @
c634219
package
com
.
alibaba
.
cloud
.
integration
.
order
.
service
.
impl
;
package
com
.
alibaba
.
cloud
.
integration
.
order
.
service
.
impl
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dao.OrderAppointmentDao
;
import
com.alibaba.cloud.integration.order.dao.*
;
import
com.alibaba.cloud.integration.order.dao.OrderChangeDao
;
import
com.alibaba.cloud.integration.order.dao.OrderRequestDao
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttRespDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttRespDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListRespDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListRespDTO
;
import
com.alibaba.cloud.integration.order.entity.OrderAppointmentEntity
;
import
com.alibaba.cloud.integration.order.entity.*
;
import
com.alibaba.cloud.integration.order.entity.OrderChangeEntity
;
import
com.alibaba.cloud.integration.order.entity.OrderRequestEntity
;
import
com.alibaba.cloud.integration.order.service.WorkbenchService
;
import
com.alibaba.cloud.integration.order.service.WorkbenchService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -36,6 +32,12 @@ public class WorkbenchServiceImpl implements WorkbenchService {
...
@@ -36,6 +32,12 @@ public class WorkbenchServiceImpl implements WorkbenchService {
@Autowired
@Autowired
private
OrderAppointmentDao
orderAppointmentDao
;
private
OrderAppointmentDao
orderAppointmentDao
;
@Autowired
private
EngineerInfoDao
engineerInfoDao
;
@Autowired
private
CapacityEngineerStatDao
capacityEngineerStatDao
;
@Override
@Override
public
Result
<?>
getOrderChangeList
(
WorkbenchOrderChangeListReqDTO
orderChangeListReqDTO
)
{
public
Result
<?>
getOrderChangeList
(
WorkbenchOrderChangeListReqDTO
orderChangeListReqDTO
)
{
Pageable
pageable
=
PageRequest
.
of
(
orderChangeListReqDTO
.
getPage
()
-
1
,
orderChangeListReqDTO
.
getSize
());
Pageable
pageable
=
PageRequest
.
of
(
orderChangeListReqDTO
.
getPage
()
-
1
,
orderChangeListReqDTO
.
getSize
());
...
@@ -82,19 +84,26 @@ public class WorkbenchServiceImpl implements WorkbenchService {
...
@@ -82,19 +84,26 @@ public class WorkbenchServiceImpl implements WorkbenchService {
if
(!
mapEngineers
.
containsKey
(
entity
.
getEngineerCode
()))
{
if
(!
mapEngineers
.
containsKey
(
entity
.
getEngineerCode
()))
{
mapEngineers
.
put
(
entity
.
getEngineerCode
(),
new
ArrayList
<>());
mapEngineers
.
put
(
entity
.
getEngineerCode
(),
new
ArrayList
<>());
}
}
WorkbenchEngineersGanttRespDTO
.
Timeline
timeline
=
new
WorkbenchEngineersGanttRespDTO
.
Timeline
();
WorkbenchEngineersGanttRespDTO
.
Order
order
=
new
WorkbenchEngineersGanttRespDTO
.
Order
();
timeline
.
setStartTime
(
entity
.
getStartTime
()).
setEndTime
(
entity
.
getEndTime
())
order
.
setStartTime
(
entity
.
getStartTime
()).
setEndTime
(
entity
.
getEndTime
())
.
set
ServiceOrderId
(
entity
.
getOrderId
()).
setService
OrderStatus
(
entity
.
getStatus
());
.
set
OrderId
(
entity
.
getOrderId
()).
set
OrderStatus
(
entity
.
getStatus
());
timeline
.
setTips
(
getOrderTips
(
entity
.
getOrderId
()));
order
.
setTips
(
getOrderTips
(
entity
.
getOrderId
()));
}
}
List
<
WorkbenchEngineersGanttRespDTO
.
GanttChart
>
engineers
=
new
ArrayList
<>();
List
<
WorkbenchEngineersGanttRespDTO
.
GanttChart
>
engineers
=
new
ArrayList
<>();
for
(
String
e
:
mapEngineers
.
keySet
())
{
for
(
String
engineerCode
:
mapEngineers
.
keySet
())
{
EngineerInfoEntity
engineerInfo
=
engineerInfoDao
.
getByEngineerCode
(
engineerCode
);
WorkbenchEngineersGanttRespDTO
.
GanttChart
engineer
=
new
WorkbenchEngineersGanttRespDTO
.
GanttChart
();
WorkbenchEngineersGanttRespDTO
.
GanttChart
engineer
=
new
WorkbenchEngineersGanttRespDTO
.
GanttChart
();
engineer
.
setEngineerCode
(
e
);
engineer
.
setEngineerCode
(
engineerCode
)
engineer
.
setStartTime
(
String
.
format
(
"%s 00:00"
,
ganttReqDTO
.
getDate
())).
setEndTime
(
String
.
format
(
"%s 23:59"
,
ganttReqDTO
.
getDate
()));
.
setStartTime
(
String
.
format
(
"%s 00:00"
,
ganttReqDTO
.
getDate
()))
engineer
.
setHoliday
(
false
);
// todo
.
setEndTime
(
String
.
format
(
"%s 23:59"
,
ganttReqDTO
.
getDate
()))
engineer
.
setTimeline
(
mapEngineers
.
get
(
e
));
.
setHoliday
(
false
)
// todo
.
setOrders
(
mapEngineers
.
get
(
engineerCode
))
.
setEngineerName
(
engineerInfo
.
getName
())
.
setGrade
(
engineerInfo
.
getGrade
());
CapacityEngineerStatEntity
capacityEngineerStat
=
capacityEngineerStatDao
.
getByEngineerCodeAndWorkday
(
engineerCode
,
ganttReqDTO
.
getDate
());
engineer
.
setCapTotal
(
capacityEngineerStat
.
getCapTotal
().
toString
()).
setCapUsed
(
capacityEngineerStat
.
getCapUsed
().
toString
());
// engineer.setErrorTip(); todo
// engineer.setErrorTip(); todo
engineers
.
add
(
engineer
);
engineers
.
add
(
engineer
);
}
}
...
...
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