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 a9e76e49
authored
Nov 20, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:工单状态统计
1 parent
e239a3eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/WorkbenchServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/WorkbenchServiceImpl.java
View file @
a9e76e4
...
...
@@ -11,6 +11,7 @@ import com.dituhui.pea.order.dto.OrderChangeListDTO;
import
com.dituhui.pea.order.dto.WorkbenchSummaryResp
;
import
com.dituhui.pea.order.entity.OrderEventEntity
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
import
com.dituhui.pea.order.enums.AppointmentMethodEnum
;
import
com.dituhui.pea.order.enums.OrderFlowEnum
;
import
com.dituhui.pea.order.service.WorkbenchService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -79,16 +80,26 @@ public class WorkbenchServiceImpl implements WorkbenchService {
return
Result
.
success
(
rs
);
}
/**
* 工作台工单状态统计
*
* @param levelType
* @param levelValue
* @param dt
* @return
*/
@Override
public
Result
<?>
getWorkbenchSummary
(
String
levelType
,
String
levelValue
,
LocalDate
dt
)
{
List
<
WorkbenchSummaryResp
.
ItemDTO
>
items
=
new
ArrayList
<>();
//处理工单分配状态 待人工处理 待自动处理 全部订单
HashMap
<
String
,
Long
>
methodSummary
=
this
.
transAppointmentMethod
(
this
.
queryCountByAppointmentMethod
(
levelType
,
levelValue
,
dt
));
WorkbenchSummaryResp
.
ItemDTO
methodItem
=
new
WorkbenchSummaryResp
.
ItemDTO
();
methodItem
.
setType
(
"order"
);
methodItem
.
setRows
(
this
.
packValueAppointmentMethod
(
methodSummary
));
items
.
add
(
methodItem
);
// 处理改约。取消。超时等状态
HashMap
<
String
,
Long
>
statusSummary
=
this
.
transOrderStatus
(
this
.
queryCountByOrderStatus
(
levelType
,
levelValue
,
dt
));
WorkbenchSummaryResp
.
ItemDTO
statusItem
=
new
WorkbenchSummaryResp
.
ItemDTO
();
statusItem
.
setType
(
"order"
);
...
...
@@ -99,7 +110,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
// - 已延误:已到开始时间,TARO没有反馈开始的工单.
valueDTOS
.
add
(
new
WorkbenchSummaryResp
.
ValueDTO
(
"已延误"
,
queryDelayNum
(
levelType
,
levelValue
,
dt
),
null
,
"#FF3D44"
,
""
,
new
HashMap
<>()));
statusItem
.
setRows
(
valueDTOS
);
// - 已超时:已
到开始
时间,TARO没有反馈开始的工单.
// - 已超时:已
过预计结束
时间,TARO没有反馈开始的工单.
valueDTOS
.
add
(
new
WorkbenchSummaryResp
.
ValueDTO
(
"已超时"
,
queryOvertimeNum
(
levelType
,
levelValue
,
dt
),
null
,
"#FF3D44"
,
""
,
new
HashMap
<>()));
statusItem
.
setRows
(
valueDTOS
);
items
.
add
(
statusItem
);
...
...
@@ -186,6 +197,14 @@ public class WorkbenchServiceImpl implements WorkbenchService {
return
rescheduledNum
;
}
/**
* 分组统计订单分配状态
*
* @param levelType
* @param levelValue
* @param dt
* @return
*/
private
List
<
Map
<
String
,
Object
>>
queryCountByAppointmentMethod
(
String
levelType
,
String
levelValue
,
LocalDate
dt
)
{
CriteriaBuilder
criteriaBuilder
=
entityManager
.
getCriteriaBuilder
();
CriteriaQuery
<
Object
[]>
criteriaQuery
=
criteriaBuilder
.
createQuery
(
Object
[].
class
);
...
...
@@ -278,6 +297,12 @@ public class WorkbenchServiceImpl implements WorkbenchService {
return
mappedResults
;
}
/**
* 组装分组数据
*
* @param results
* @return
*/
private
HashMap
<
String
,
Long
>
transAppointmentMethod
(
List
<
Map
<
String
,
Object
>>
results
)
{
HashMap
<
String
,
Long
>
map
=
new
HashMap
<>();
...
...
@@ -291,15 +316,15 @@ public class WorkbenchServiceImpl implements WorkbenchService {
total
+=
count
;
if
(
method
.
equals
(
"MANUAL"
))
{
if
(
method
.
equals
(
AppointmentMethodEnum
.
MANUAL
.
name
()
))
{
manualTotal
+=
count
;
}
else
if
(
method
.
startsWith
(
"AUTO_"
))
{
autoTotal
+=
count
;
}
if
(
method
.
equals
(
"MANUAL"
)
&&
status
.
equals
(
"INIT"
))
{
if
(
method
.
equals
(
AppointmentMethodEnum
.
MANUAL
.
name
())
&&
status
.
equals
(
OrderFlowEnum
.
INIT
.
name
()
))
{
map
.
put
(
"manualDealing"
,
count
);
}
else
if
(
method
.
equals
(
"AUTO_"
)
&&
status
.
equals
(
"INIT"
))
{
}
else
if
(
method
.
startsWith
(
"AUTO_"
)
&&
status
.
equals
(
OrderFlowEnum
.
INIT
.
name
()
))
{
map
.
put
(
"autoDealing"
,
count
);
}
}
...
...
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