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
a43ebd42
Commit
a43ebd42
authored
Mar 14, 2025
by
温志超
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
931640bc
a4f12d60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
KanbanEquipmentService.java
.../com/ximai/mes/kanban/service/KanbanEquipmentService.java
+22
-0
KanbanTaskService.java
.../java/com/ximai/mes/kanban/service/KanbanTaskService.java
+4
-2
ProTaskServiceImpl.java
...m/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
+1
-1
No files found.
mes/src/main/java/com/ximai/mes/kanban/service/KanbanEquipmentService.java
View file @
a43ebd42
...
...
@@ -2,6 +2,7 @@ package com.ximai.mes.kanban.service;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.mes.cal.domain.CalPlanWorkunit
;
...
...
@@ -22,6 +23,7 @@ import com.ximai.mes.qc.dto.QcAbnormalReportDto;
import
com.ximai.mes.qc.dto.QcAbnormalReportStatusEnum
;
import
com.ximai.mes.qc.mapper.QcAbnormalReportMapper
;
import
com.ximai.mes.qc.service.IQcAbnormalReportService
;
import
com.ximai.system.service.ISysConfigService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -50,6 +52,12 @@ public class KanbanEquipmentService {
IQcAbnormalReportService
abnormalReportService
;
@Autowired
QcAbnormalReportMapper
abnormalReportMapper
;
@Autowired
ISysConfigService
configService
;
//利用率增长
private
String
OT_RATIO_APPEND_KEY
=
"kanban.equ.output.ratio.append"
;
//最低利用率
private
String
OT_RATIO_LOWER_KEY
=
"kanban.equ.output.ratio.lower"
;
@ApiOperation
(
"设备统计"
)
@PostMapping
(
"/currentMonthStat"
)
...
...
@@ -178,6 +186,7 @@ public class KanbanEquipmentService {
}
if
(
calTime
.
get
().
compareTo
(
BigDecimal
.
ZERO
)>
0
){
rst
.
setEquipAvailability
(
machineTime
.
get
().
divide
(
calTime
.
get
(),
3
,
BigDecimal
.
ROUND_DOWN
).
multiply
(
new
BigDecimal
(
"100"
)));
//利用率
rst
.
setEquipAvailability
(
this
.
resetAvailability
(
rst
.
getEquipAvailability
()));
}
}
...
...
@@ -203,4 +212,17 @@ public class KanbanEquipmentService {
return
calTime
.
get
();
}
private
BigDecimal
resetAvailability
(
BigDecimal
source
){
String
otRatioAppend
=
configService
.
selectConfigByKey
(
OT_RATIO_APPEND_KEY
);
String
otRatioLower
=
configService
.
selectConfigByKey
(
OT_RATIO_LOWER_KEY
);
if
(
StrUtil
.
isNumeric
(
otRatioAppend
)
&&
StrUtil
.
isNumeric
(
otRatioLower
)){
BigDecimal
otRatioAppend1
=
new
BigDecimal
(
otRatioAppend
);
BigDecimal
otRatioLower1
=
new
BigDecimal
(
otRatioLower
);
if
(
source
.
compareTo
(
otRatioLower1
)<
0
){
source
=
source
.
add
(
otRatioAppend1
);
}
}
return
source
;
}
}
mes/src/main/java/com/ximai/mes/kanban/service/KanbanTaskService.java
View file @
a43ebd42
...
...
@@ -120,7 +120,8 @@ public class KanbanTaskService {
.
add
(
feedbackDto
.
getQuantityQualify
().
add
(
feedbackDto
.
getQuantityUnqualify
())));
}
}
if
(
s
.
getActualEndDate
()!=
null
&&
s
.
getActualEndDate
().
compareTo
(
s
.
getScheduleEndDate
())<
0
){
if
(
s
.
getActualEndDate
()!=
null
&&
s
.
getActualEndDate
().
compareTo
(
s
.
getScheduleEndDate
())<
0
&&
s
.
getScheduleEndDate
().
compareTo
(
curr
.
getTime
())<
0
){
endOnTimeRatioNumerator
.
set
(
endOnTimeRatioNumerator
.
get
().
add
(
BigDecimal
.
ONE
));
}
if
(
s
.
getScheduleEndDate
().
compareTo
(
curr
.
getTime
())<
0
){
...
...
@@ -142,7 +143,8 @@ public class KanbanTaskService {
AtomicReference
<
BigDecimal
>
startOnTimeRatioDenominator
=
new
AtomicReference
<>(
BigDecimal
.
ZERO
);
taskWorkunitDtoMap2
.
forEach
((
k
,
v
)->{
v
.
forEach
(
s
->{
if
(
s
.
getActualStartDate
()!=
null
&&
s
.
getActualStartDate
().
compareTo
(
s
.
getScheduleStartDate
())<
0
){
if
(
s
.
getActualStartDate
()!=
null
&&
s
.
getActualStartDate
().
compareTo
(
s
.
getScheduleStartDate
())<
0
&&
s
.
getScheduleStartDate
().
compareTo
(
curr
.
getTime
())<
0
){
startOnTimeRatioNumerator
.
set
(
startOnTimeRatioNumerator
.
get
().
add
(
BigDecimal
.
ONE
));
}
if
(
s
.
getScheduleStartDate
().
compareTo
(
curr
.
getTime
())<
0
){
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
View file @
a43ebd42
...
...
@@ -961,7 +961,7 @@ public class ProTaskServiceImpl implements IProTaskService {
proStartWorkService
.
updateProStartWork
(
x
);
}
);
proTaskWorkunit
.
setActualEndDate
(
new
Date
());
proTaskWorkunit
.
setStatus
(
TaskWorkunitStatusEnum
.
FINISHED
.
getStatus
());
proTaskWorkunitService
.
updateProTaskWorkunit
(
proTaskWorkunit
);
//最后一道工序完工
...
...
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