Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes
Commits
5503ce41
Commit
5503ce41
authored
Nov 06, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常原因不合格分布数据更换接口
parent
6c023a48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
40 deletions
+62
-40
KanbanTaskController.java
...com/ximai/mes/kanban/controller/KanbanTaskController.java
+22
-0
AbnormalMonthStatDto.java
...m/ximai/mes/kanban/dto/abnormal/AbnormalMonthStatDto.java
+0
-14
TaskStatDto.java
.../main/java/com/ximai/mes/kanban/dto/task/TaskStatDto.java
+14
-0
KanbanAbnormalService.java
...a/com/ximai/mes/kanban/service/KanbanAbnormalService.java
+26
-26
No files found.
mes/src/main/java/com/ximai/mes/kanban/controller/KanbanTaskController.java
View file @
5503ce41
package
com
.
ximai
.
mes
.
kanban
.
controller
;
import
com.ximai.common.core.domain.AjaxResult
;
import
com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto
;
import
com.ximai.mes.kanban.dto.task.TaskStatDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -102,6 +103,27 @@ public class KanbanTaskController {
processMonthlyIndexDto
.
setQualifiedRatio
(
new
BigDecimal
(
"95"
));
processMonthlyIndexDto
.
setMonthPlanConcludeRatio
(
new
BigDecimal
(
"35"
));
rst
.
setProcessMonthlyIndexDto
(
processMonthlyIndexDto
);
List
<
TaskStatDto
.
AbnormalCauseStat
>
abnormalCauseStats
=
new
ArrayList
<>();
abnormalCauseStats
.
add
(
new
TaskStatDto
.
AbnormalCauseStat
(){
{
setCause
(
"停电"
);
setCt
(
2
);
}
});
abnormalCauseStats
.
add
(
new
TaskStatDto
.
AbnormalCauseStat
(){
{
setCause
(
"设备损坏"
);
setCt
(
4
);
}
});
abnormalCauseStats
.
add
(
new
TaskStatDto
.
AbnormalCauseStat
(){
{
setCause
(
"硬件故障"
);
setCt
(
0
);
}
});
rst
.
setAbnormalCauseData
(
abnormalCauseStats
);
return
AjaxResult
.
success
(
rst
);
}
...
...
mes/src/main/java/com/ximai/mes/kanban/dto/abnormal/AbnormalMonthStatDto.java
View file @
5503ce41
...
...
@@ -25,9 +25,6 @@ public class AbnormalMonthStatDto {
@ApiModelProperty
(
"设备近七天故障数,顺序为:索引0当天、1昨天、2前天"
)
List
<
Integer
>
equipErrorArr
=
new
ArrayList
<>();
@ApiModelProperty
(
"异常原因不合格分布"
)
List
<
AbnormalCauseStat
>
abnormalCauseData
;
@Data
public
static
class
AbnormalMonthStatDetail
{
@ApiModelProperty
(
"异常总数"
)
...
...
@@ -38,15 +35,4 @@ public class AbnormalMonthStatDto {
Integer
expireUnClose
=
0
;
}
@Data
public
static
class
AbnormalCauseStat
{
@ApiModelProperty
(
"异常原因"
)
String
cause
;
@ApiModelProperty
(
"异常原因"
)
Integer
ct
=
0
;
}
}
mes/src/main/java/com/ximai/mes/kanban/dto/task/TaskStatDto.java
View file @
5503ce41
...
...
@@ -18,6 +18,20 @@ public class TaskStatDto {
@ApiModelProperty
(
"工序月统计指标"
)
ProcessMonthlyIndexDto
processMonthlyIndexDto
;
@ApiModelProperty
(
"异常原因不合格分布"
)
List
<
AbnormalCauseStat
>
abnormalCauseData
;
@Data
public
static
class
AbnormalCauseStat
{
@ApiModelProperty
(
"异常原因"
)
String
cause
;
@ApiModelProperty
(
"异常原因"
)
Integer
ct
=
0
;
}
@Data
public
static
class
ProcessOutput
{
...
...
mes/src/main/java/com/ximai/mes/kanban/service/KanbanAbnormalService.java
View file @
5503ce41
...
...
@@ -68,32 +68,32 @@ public class KanbanAbnormalService {
workunitQuery
.
eq
(
"enable_flag"
,
"Y"
);
int
workunitCt
=
workunitMapper
.
selectCount
(
workunitQuery
);
rst
.
setEquipCt
(
workunitCt
-
abnormalEquipCt
);
List
<
QcAbnormalReportDto
>
unqualifiedAbnormal
=
abnormalTypeMap
.
getOrDefault
(
QcAbnormalTypeEnum
.
UNQUALIFIED_REASON
.
getType
(),
new
ArrayList
<>());
//按不合格原因分组
Map
<
String
,
List
<
QcAbnormalReportDto
>>
unqualifiedAbnormalMap
=
unqualifiedAbnormal
.
stream
().
collect
(
Collectors
.
groupingBy
(
s
->
s
.
getAbnormalReason
()));
//查询不合格原因
QcAbnormalInformation
qcAbnormalInformationQuery
=
new
QcAbnormalInformation
();
qcAbnormalInformationQuery
.
setAbnormalType
(
QcAbnormalTypeEnum
.
UNQUALIFIED_REASON
.
getType
());
List
<
QcAbnormalInformation
>
abnormalInfoList
=
abnormalInformationService
.
selectQcAbnormalInformationList
(
qcAbnormalInformationQuery
);
LinkedHashMap
<
String
,
Integer
>
unqualifiedAbnormalRstMap
=
new
LinkedHashMap
<>();
List
<
AbnormalMonthStatDto
.
AbnormalCauseStat
>
abnormalCauseStats
=
new
ArrayList
<>();
abnormalInfoList
.
forEach
(
s
->{
if
(!
unqualifiedAbnormalMap
.
containsKey
(
s
.
getAbnormalReason
())){
unqualifiedAbnormalRstMap
.
put
(
s
.
getAbnormalReason
(),
0
);
}
else
{
unqualifiedAbnormalRstMap
.
put
(
s
.
getAbnormalReason
(),
unqualifiedAbnormalMap
.
get
(
s
.
getAbnormalReason
()).
size
());
}
});
Map
<
String
,
Integer
>
queueUnqualifiedMap
=
MapUtil
.
sortByValue
(
unqualifiedAbnormalRstMap
,
true
);
queueUnqualifiedMap
.
forEach
((
k
,
v
)->{
abnormalCauseStats
.
add
(
new
AbnormalMonthStatDto
.
AbnormalCauseStat
(){
{
setCt
(
v
);
setCause
(
k
);
}
});
});
rst
.
setAbnormalCauseData
(
abnormalCauseStats
);
//
List<QcAbnormalReportDto> unqualifiedAbnormal = abnormalTypeMap.getOrDefault(QcAbnormalTypeEnum.UNQUALIFIED_REASON.getType(), new ArrayList<>());
//
//按不合格原因分组
//
Map<String, List<QcAbnormalReportDto>> unqualifiedAbnormalMap = unqualifiedAbnormal.stream().collect(Collectors.groupingBy(s->s.getAbnormalReason()));
//
//查询不合格原因
//
QcAbnormalInformation qcAbnormalInformationQuery = new QcAbnormalInformation();
//
qcAbnormalInformationQuery.setAbnormalType(QcAbnormalTypeEnum.UNQUALIFIED_REASON.getType());
//
List<QcAbnormalInformation> abnormalInfoList = abnormalInformationService.selectQcAbnormalInformationList(qcAbnormalInformationQuery);
//
LinkedHashMap<String, Integer> unqualifiedAbnormalRstMap = new LinkedHashMap<>();
//
List<AbnormalMonthStatDto.AbnormalCauseStat> abnormalCauseStats = new ArrayList<>();
//
abnormalInfoList.forEach(s->{
//
if(!unqualifiedAbnormalMap.containsKey(s.getAbnormalReason())){
//
unqualifiedAbnormalRstMap.put(s.getAbnormalReason(), 0);
//
}else {
//
unqualifiedAbnormalRstMap.put(s.getAbnormalReason(), unqualifiedAbnormalMap.get(s.getAbnormalReason()).size());
//
}
//
});
//
Map<String,Integer> queueUnqualifiedMap = MapUtil.sortByValue(unqualifiedAbnormalRstMap, true);
//
queueUnqualifiedMap.forEach((k,v)->{
//
abnormalCauseStats.add(new AbnormalMonthStatDto.AbnormalCauseStat(){
//
{
//
setCt(v);
//
setCause(k);
//
}
//
});
//
});
//
rst.setAbnormalCauseData(abnormalCauseStats);
//查询七天内设备异常,按天统计
Calendar
last7Day
=
Calendar
.
getInstance
();
last7Day
.
set
(
Calendar
.
DATE
,
-
6
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment