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
df3b9749
Commit
df3b9749
authored
Sep 23, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外协报工调整
parent
646666d8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
40 deletions
+13
-40
ProTaskMobController.java
...ximai/mes/pro/controller/mobile/ProTaskMobController.java
+1
-0
IProFeedbackService.java
...n/java/com/ximai/mes/pro/service/IProFeedbackService.java
+1
-1
ProFeedbackServiceImpl.java
...om/ximai/mes/pro/service/impl/ProFeedbackServiceImpl.java
+2
-5
ProTaskAssistProcessServiceImpl.java
...ro/service/impl/task/ProTaskAssistProcessServiceImpl.java
+6
-33
ProTaskServiceImpl.java
...m/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
+1
-1
ProTaskWorkunitServiceImpl.java
...mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
+1
-0
ProProcessMapper.xml
mes/src/main/resources/mapper/pro/ProProcessMapper.xml
+1
-0
No files found.
mes/src/main/java/com/ximai/mes/pro/controller/mobile/ProTaskMobController.java
View file @
df3b9749
...
...
@@ -264,6 +264,7 @@ public class ProTaskMobController extends BaseController {
//验证是否报工
QueryWrapper
<
ProFeedback
>
feedbackQuery
=
new
QueryWrapper
<>();
feedbackQuery
.
eq
(
"qrcode"
,
validateSerialNoParams
.
getQrcode
());
feedbackQuery
.
eq
(
"task_workunit_id"
,
validateSerialNoParams
.
getTaskWorkunitId
());
List
<
ProFeedback
>
feedbackList
=
proFeedbackService
.
selectProFeedbackList
(
feedbackQuery
);
if
(
feedbackList
.
size
()>
0
){
throw
new
ServiceException
(
"该序列号任务已报工"
);
...
...
mes/src/main/java/com/ximai/mes/pro/service/IProFeedbackService.java
View file @
df3b9749
...
...
@@ -87,7 +87,7 @@ public interface IProFeedbackService {
LinkedHashMap
<
String
,
ProFeedbackSplitInfo
>
taskFeedback
(
ProTask
proTask
,
ProFeedback
mainFeedBack
);
List
<
ProPackagePrintResult
>
assistFeedBack
(
ProFeedback
feedback
,
ProTaskAssistProcess
assistProcess
);
List
<
ProPackagePrintResult
>
assistFeedBack
(
ProFeedback
feedback
);
// 上传报工信息到sap
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/ProFeedbackServiceImpl.java
View file @
df3b9749
...
...
@@ -834,7 +834,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
}
@Override
public
List
<
ProPackagePrintResult
>
assistFeedBack
(
ProFeedback
feedback
,
ProTaskAssistProcess
assistProcess
)
{
public
List
<
ProPackagePrintResult
>
assistFeedBack
(
ProFeedback
feedback
)
{
BigDecimal
quantityFeedback
=
feedback
.
getQuantityFeedback
();
ExceptionUtil
.
checkTrueThrowException
(
quantityFeedback
.
doubleValue
()
<=
0
,
"报工数量不能低于0"
);
...
...
@@ -844,7 +844,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
SAPDtoFeedback
sapDtoFeedback
=
new
SAPDtoFeedback
();
sapDtoFeedback
.
setWorkorderCode
(
assistProcess
.
getWorkorderCode
());
sapDtoFeedback
.
setWorkorderCode
(
feedback
.
getWorkorderCode
());
sapDtoFeedback
.
setConfirm
(
"1"
);
BigDecimal
quantityUnqualify
=
DataUtil
.
getNormalData
(
feedback
.
getQuantityUnqualify
());
if
(
quantityUnqualify
.
intValue
()
>
0
)
{
...
...
@@ -852,7 +852,6 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
}
sapDtoFeedback
.
setConfirmText
(
""
);
sapDtoFeedback
.
setProcessOrder
(
assistProcess
.
getIdx
());
sapDtoFeedback
.
setWorkstationCode
(
feedback
.
getWorkstationCode
());
sapDtoFeedback
.
setFeedbackQuantity
(
DataUtil
.
getNormalData
(
feedback
.
getQuantityQualify
()).
intValue
());
sapDtoFeedback
.
setFeedbackScrapQuantity
(
quantityUnqualify
.
intValue
());
...
...
@@ -880,8 +879,6 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
sapDtoFeedback
.
setBreakTime
(
"0"
);
sapDtoFeedback
.
setBreakTimeUnit
(
"MIN"
);
// 判断反冲料
SapServiceFeedback
.
builder
().
feedback
(
feedback
).
sapDtoFeedback
(
sapDtoFeedback
).
proWorkorderMapper
(
proWorkorderMapper
).
actionMsg
(
"外协报工"
).
build
().
execute
();
this
.
insertProFeedback
(
feedback
);
return
null
;
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskAssistProcessServiceImpl.java
View file @
df3b9749
...
...
@@ -6,10 +6,7 @@ import com.ximai.common.constant.DataConstans;
import
com.ximai.common.utils.data.DataUtil
;
import
com.ximai.common.utils.data.ExceptionUtil
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.mes.constant.AssistProcessConst
;
import
com.ximai.mes.constant.TaskConst
;
import
com.ximai.mes.constant.TaskStatusEnum
;
import
com.ximai.mes.constant.TaskWorkunitStatusEnum
;
import
com.ximai.mes.constant.*
;
import
com.ximai.mes.face.sap.SapService
;
import
com.ximai.mes.face.sap.execute.SapServiceAssistProcess
;
import
com.ximai.mes.pro.domain.ProFeedback
;
...
...
@@ -361,25 +358,22 @@ public class ProTaskAssistProcessServiceImpl implements IProTaskAssistProcessSer
@Override
public
int
feedBack
(
ProFeedback
feedback
)
{
Long
taskWorkunitId
=
feedback
.
getTaskWorkunitId
();
ProTaskAssistProcess
proTaskAssistProcess
=
this
.
selectBaseByObj
(
new
ProTaskAssistProcess
(
taskWorkunitId
));
ExceptionUtil
.
checkTrueThrowException
(
StringUtils
.
isEmpty
(
proTaskAssistProcess
),
"外协记录不存在"
);
ProTaskWorkunit
taskWorkunit
=
proTaskWorkunitService
.
selectProTaskWorkunitByTaskWorkunitId
(
taskWorkunitId
);
ProWorkorder
workorder
=
proWorkorderMapper
.
selectWorkorderById
(
feedback
.
getWorkorderId
());
ExceptionUtil
.
checkTrueThrowException
(
taskWorkunit
==
null
,
"排产任务不存在"
);
ExceptionUtil
.
checkTrueThrowException
(!
taskWorkunit
.
getStatus
().
equals
(
TaskStatusEnum
.
BEGINNING
.
getStatus
()),
"请先进行开始作业操作"
);
feedback
.
initValue
(
workorder
);
Double
feedbackSum
=
proFeedbackService
.
selectQuantityQualifySum
(
new
ProFeedback
(
null
,
null
,
null
,
taskWorkunitId
));
double
taskQuantityDouble
=
taskWorkunit
.
getQuantity
().
doubleValue
();
double
canBeWaitQuantity
=
taskQuantityDouble
-
feedbackSum
;
ExceptionUtil
.
checkTrueThrowException
(
canBeWaitQuantity
<=
0
,
"报工数量为0,不可报工"
);
BigDecimal
quantityQualify
=
feedback
.
getQuantityQualify
();
BigDecimal
quantityUnQualify
=
feedback
.
getQuantityUnqualify
();
BigDecimal
quantityFeedback
=
quantityQualify
.
add
(
quantityUnQualify
);
double
quantityFeedbackDouble
=
quantityFeedback
.
doubleValue
();
ExceptionUtil
.
checkTrueThrowException
(
quantityFeedbackDouble
>
canBeWaitQuantity
,
"报工数量大于可报工数量"
);
ProTask
task
=
proTaskService
.
selectBaseById
(
proTaskAssistProcess
.
getTaskId
());
ProTask
task
=
proTaskService
.
selectBaseById
(
taskWorkunit
.
getTaskId
());
BigDecimal
taskQuantityWait
=
task
.
getQuantityWait
();
ExceptionUtil
.
checkTrueThrowException
(
quantityFeedbackDouble
>
taskQuantityWait
.
longValue
()
||
quantityFeedbackDouble
>
taskQuantityDouble
,
"可加工数量不足"
);
...
...
@@ -399,17 +393,9 @@ public class ProTaskAssistProcessServiceImpl implements IProTaskAssistProcessSer
proTaskWorkunitService
.
updateProTaskWorkunit
(
taskWorkunit
);
}
//暂停更新记录
if
(
Objects
.
equals
(
taskWorkunit
.
getStatus
(),
FINISHED
.
getStatus
()))
{
proStartWorkService
.
closeObj
(
feedback
);
}
else
{
proStartWorkService
.
updateObj
(
feedback
);
}
//按派工表保存报工记录
feedback
.
setWorkorderId
(
proTaskAssistProcess
.
getWorkorderId
());
proFeedbackService
.
assistFeedBack
(
feedback
,
proTaskAssistProcess
);
feedback
.
setFeedbackType
(
"SELF"
);
proFeedbackService
.
insertProFeedback
(
feedback
);
//查询关联下道工序
ProTask
nextTask
=
proTaskService
.
getNextTaskByTaskId
(
feedback
.
getTaskId
());
...
...
@@ -429,26 +415,13 @@ public class ProTaskAssistProcessServiceImpl implements IProTaskAssistProcessSer
proTaskService
.
updateProTask
(
nextTask
);
}
proTaskService
.
updateProTask
(
task
);
ProWorkorder
proWorkorder
=
proWorkorderMapper
.
selectWorkorderById
(
proTaskAssistProcess
.
getWorkorderId
());
proWorkorder
.
setQuantityQualify
(
proWorkorder
.
getQuantityQualify
().
add
(
quantityQualify
));
proWorkorder
.
setQuantityUnqualify
(
proWorkorder
.
getQuantityUnqualify
().
add
(
quantityUnQualify
));
proWorkorder
.
setQuantityProduced
(
DataUtil
.
getNormalData
(
proWorkorder
.
getQuantityProduced
()).
add
(
quantityQualify
));
proWorkorderService
.
updateProWorkorder
(
proWorkorder
);
proTaskWorkunitService
.
updateProTaskWorkunit
(
taskWorkunit
);
//打印记录
if
(
"1"
.
equals
(
feedback
.
getPrintContents
()))
{
proFdQrcodePrintRecordService
.
insertProFdQrcodePrintRecordfeedback
(
feedback
);
}
SapServiceAssistProcess
.
builder
().
proTaskAssistProcess
(
proTaskAssistProcess
).
feedback
(
feedback
).
build
().
execute
();
return
1
;
}
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
View file @
df3b9749
...
...
@@ -1859,7 +1859,7 @@ public class ProTaskServiceImpl implements IProTaskService {
String
arrangeCode
=
task
.
getArrangeCode
();
if
(
StringUtils
.
isNotEmpty
(
arrangeCode
))
{
ProWorkorderQuery
workorderQuery
=
new
ProWorkorderQuery
();
workorderQuery
.
set
Arrange
Code
(
arrangeCode
);
workorderQuery
.
set
Workorder
Code
(
arrangeCode
);
List
<
ProWorkorder
>
proWorkorders
=
proWorkorderService
.
selectProWorkorderList
(
workorderQuery
);
task
.
setProWorkorderList
(
proWorkorders
);
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
View file @
df3b9749
...
...
@@ -523,6 +523,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
taskWorkunitIds
.
forEach
(
id
->{
ProTaskWorkunit
taskWorkunit
=
this
.
selectProTaskWorkunitByTaskWorkunitId
(
id
);
taskWorkunit
.
setOutsourced
(
1
);
taskWorkunit
.
setStatus
(
TaskStatusEnum
.
BEGINNING
.
getStatus
());
this
.
updateProTaskWorkunit
(
taskWorkunit
);
});
}
...
...
mes/src/main/resources/mapper/pro/ProProcessMapper.xml
View file @
df3b9749
...
...
@@ -32,6 +32,7 @@
attention,
enable_flag,
is_package,
is_serial_report,
remark,
attr1,
attr2,
...
...
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