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
a7f84ce3
Commit
a7f84ce3
authored
Oct 28, 2024
by
温志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新报工逻辑,将不良品增加到可加工数中
parent
9b92e2c8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
33 deletions
+45
-33
ProProductionSolutionProcess.java
...main/productionSolution/ProProductionSolutionProcess.java
+5
-1
ProProductionSolutionProcessVo.java
...mai/mes/pro/domain/vo/ProProductionSolutionProcessVo.java
+8
-0
ProWorkorderQuery.java
...n/java/com/ximai/mes/pro/domain/vo/ProWorkorderQuery.java
+4
-0
IProFeedbackService.java
...n/java/com/ximai/mes/pro/service/IProFeedbackService.java
+5
-0
ProFeedbackServiceImpl.java
...om/ximai/mes/pro/service/impl/ProFeedbackServiceImpl.java
+4
-2
ProTaskServiceImpl.java
...m/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
+14
-29
ProProductionSolutionProcessMapper.xml
...productionSolution/ProProductionSolutionProcessMapper.xml
+5
-1
No files found.
mes/src/main/java/com/ximai/mes/pro/domain/productionSolution/ProProductionSolutionProcess.java
View file @
a7f84ce3
...
@@ -239,5 +239,9 @@ public class ProProductionSolutionProcess {
...
@@ -239,5 +239,9 @@ public class ProProductionSolutionProcess {
/** 封切机分切 */
/** 封切机分切 */
@Excel
(
name
=
"封切机分切"
)
@Excel
(
name
=
"封切机分切"
)
private
String
sacmForSlitting
;
private
String
sacmForSlitting
;
/**
* 规格书
*/
@ApiModelProperty
(
"单价"
)
private
BigDecimal
unitPrice
;
}
}
mes/src/main/java/com/ximai/mes/pro/domain/vo/ProProductionSolutionProcessVo.java
View file @
a7f84ce3
...
@@ -241,6 +241,14 @@ public class ProProductionSolutionProcessVo extends BaseEntity {
...
@@ -241,6 +241,14 @@ public class ProProductionSolutionProcessVo extends BaseEntity {
@ApiModelProperty
(
"工装夹具"
)
@ApiModelProperty
(
"工装夹具"
)
private
List
<
ProProductionSolutionProcessToolVo
>
toolList
=
new
ArrayList
<>();
private
List
<
ProProductionSolutionProcessToolVo
>
toolList
=
new
ArrayList
<>();
/**
* 规格书
*/
@ApiModelProperty
(
"单价"
)
private
BigDecimal
unitPrice
;
/**
/**
* 生产版本工序图纸
* 生产版本工序图纸
**/
**/
...
...
mes/src/main/java/com/ximai/mes/pro/domain/vo/ProWorkorderQuery.java
View file @
a7f84ce3
...
@@ -227,7 +227,11 @@ public class ProWorkorderQuery extends BaseEntity {
...
@@ -227,7 +227,11 @@ public class ProWorkorderQuery extends BaseEntity {
private
Long
taskWorkunitId
;
private
Long
taskWorkunitId
;
private
String
parentId
;
private
String
parentId
;
@ApiModelProperty
(
"订单单号"
)
private
String
orderCode
;
@ApiModelProperty
(
"订单序号"
)
private
String
orderSerial
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
Long
>
workorderIds
;
private
List
<
Long
>
workorderIds
;
...
...
mes/src/main/java/com/ximai/mes/pro/service/IProFeedbackService.java
View file @
a7f84ce3
...
@@ -90,6 +90,11 @@ public interface IProFeedbackService {
...
@@ -90,6 +90,11 @@ public interface IProFeedbackService {
int
deleteProFeedbackByRecordId
(
Long
recordId
);
int
deleteProFeedbackByRecordId
(
Long
recordId
);
/**
* 温志超修改 :合格和非合格数量都将计入数量中
* @param proFeedback
* @return
*/
Double
selectQuantityQualifySum
(
ProFeedback
proFeedback
);
Double
selectQuantityQualifySum
(
ProFeedback
proFeedback
);
LinkedHashMap
<
String
,
ProFeedbackSplitInfo
>
taskFeedback
(
ProTask
proTask
,
ProFeedback
mainFeedBack
);
LinkedHashMap
<
String
,
ProFeedbackSplitInfo
>
taskFeedback
(
ProTask
proTask
,
ProFeedback
mainFeedBack
);
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/ProFeedbackServiceImpl.java
View file @
a7f84ce3
...
@@ -802,8 +802,10 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
...
@@ -802,8 +802,10 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
}
else
{
}
else
{
queryWrapper
.
eq
(
StringUtils
.
isNotEmpty
(
proFeedback
.
getWorkorderId
()),
"workorder_id"
,
proFeedback
.
getWorkorderId
());
queryWrapper
.
eq
(
StringUtils
.
isNotEmpty
(
proFeedback
.
getWorkorderId
()),
"workorder_id"
,
proFeedback
.
getWorkorderId
());
}
}
DoubleSummaryStatistics
collect
=
proFeedbackMapper
.
selectListByQw
(
queryWrapper
).
stream
().
collect
(
Collectors
.
summarizingDouble
(
x
->
DataUtil
.
getNormalData
(
x
.
getQuantityQualify
()).
doubleValue
()));
DoubleSummaryStatistics
collectQuantityQualify
=
proFeedbackMapper
.
selectListByQw
(
queryWrapper
).
stream
().
collect
(
Collectors
.
summarizingDouble
(
x
->
DataUtil
.
getNormalData
(
x
.
getQuantityQualify
()).
doubleValue
()));
return
collect
.
getSum
();
DoubleSummaryStatistics
collectQuantityUnqualify
=
proFeedbackMapper
.
selectListByQw
(
queryWrapper
).
stream
().
collect
(
Collectors
.
summarizingDouble
(
x
->
DataUtil
.
getNormalData
(
x
.
getQuantityUnqualify
()).
doubleValue
()));
return
collectQuantityQualify
.
getSum
()
+
collectQuantityUnqualify
.
getSum
();
}
}
@Override
@Override
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
View file @
a7f84ce3
...
@@ -772,8 +772,10 @@ public class ProTaskServiceImpl implements IProTaskService {
...
@@ -772,8 +772,10 @@ public class ProTaskServiceImpl implements IProTaskService {
public
List
<
ProPackagePrintResult
>
feedBack
(
ProFeedback
feedback
)
{
public
List
<
ProPackagePrintResult
>
feedBack
(
ProFeedback
feedback
)
{
List
<
ProPackagePrintResult
>
response
=
new
ArrayList
<>();
List
<
ProPackagePrintResult
>
response
=
new
ArrayList
<>();
BigDecimal
feedbackQualifyConst
=
feedback
.
getQuantityQualify
();
BigDecimal
feedbackQualifyConst
=
feedback
.
getQuantityQualify
();
ExceptionUtil
.
checkTrueThrowException
(
feedbackQualifyConst
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
BigDecimal
fuantityUnqualify
=
feedback
.
getQuantityUnqualify
();
MessageUtils
.
message
(
"pro.feedback.error.min.quantity"
));
//温志超修改 :合格和非合格数量都不允许小于0
ExceptionUtil
.
checkTrueThrowException
(
feedbackQualifyConst
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
||
fuantityUnqualify
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
MessageUtils
.
message
(
"pro.feedback.error.min.quantity、unqualify"
));
if
(
StringUtils
.
isNotEmpty
(
feedback
.
getQrcode
())){
if
(
StringUtils
.
isNotEmpty
(
feedback
.
getQrcode
())){
FeedbackValidateSerialNoParams
feedbackValidateSerialNoParams
=
new
FeedbackValidateSerialNoParams
();
FeedbackValidateSerialNoParams
feedbackValidateSerialNoParams
=
new
FeedbackValidateSerialNoParams
();
feedbackValidateSerialNoParams
.
setQrcode
(
feedback
.
getQrcode
());
feedbackValidateSerialNoParams
.
setQrcode
(
feedback
.
getQrcode
());
...
@@ -784,7 +786,7 @@ public class ProTaskServiceImpl implements IProTaskService {
...
@@ -784,7 +786,7 @@ public class ProTaskServiceImpl implements IProTaskService {
ProTaskWorkunit
taskWorkunit
=
proTaskWorkunitService
.
selectProTaskWorkunitByTaskWorkunitId
(
feedback
.
getTaskWorkunitId
());
ProTaskWorkunit
taskWorkunit
=
proTaskWorkunitService
.
selectProTaskWorkunitByTaskWorkunitId
(
feedback
.
getTaskWorkunitId
());
ExceptionUtil
.
checkTrueThrowException
(!
taskWorkunit
.
getStatus
().
equals
(
TaskStatusEnum
.
BEGINNING
.
getStatus
()),
MessageUtils
.
message
(
"pro.feedback.error.before.start"
));
ExceptionUtil
.
checkTrueThrowException
(!
taskWorkunit
.
getStatus
().
equals
(
TaskStatusEnum
.
BEGINNING
.
getStatus
()),
MessageUtils
.
message
(
"pro.feedback.error.before.start"
));
//
更新派工表
数量
//
检索已经报工的
数量
double
execQuantityQualifySumConst
=
proFeedbackService
.
selectQuantityQualifySum
(
new
ProFeedback
(
null
,
null
,
null
,
taskWorkunit
.
getTaskWorkunitId
()));
double
execQuantityQualifySumConst
=
proFeedbackService
.
selectQuantityQualifySum
(
new
ProFeedback
(
null
,
null
,
null
,
taskWorkunit
.
getTaskWorkunitId
()));
ProTask
task
=
this
.
selectProTaskByTaskId
(
feedback
.
getTaskId
());
ProTask
task
=
this
.
selectProTaskByTaskId
(
feedback
.
getTaskId
());
...
@@ -808,40 +810,23 @@ public class ProTaskServiceImpl implements IProTaskService {
...
@@ -808,40 +810,23 @@ public class ProTaskServiceImpl implements IProTaskService {
=
proProductionSolutionMapper
.
selectProProductionSolutionByProductionSolutionId
(
proWorkorders
.
get
(
0
).
getProductionSolutionId
());
=
proProductionSolutionMapper
.
selectProProductionSolutionByProductionSolutionId
(
proWorkorders
.
get
(
0
).
getProductionSolutionId
());
if
(
proProductionSolution
!=
null
&&
proProductionSolution
.
getSurpassState
()
!=
null
){
if
(
proProductionSolution
!=
null
&&
proProductionSolution
.
getSurpassState
()
!=
null
){
if
(!
proProductionSolution
.
getSurpassState
()){
if
(!
proProductionSolution
.
getSurpassState
()){
//不允许超报 可报工数目 -
合格数
不能小于 0
//不允许超报 可报工数目 -
(合格数 + 不合格数)
不能小于 0
ExceptionUtil
.
checkTrueThrowException
(
ExceptionUtil
.
checkTrueThrowException
(
taskQuantityWaitConst
.
compareTo
(
feedbackQualifyConst
)
<
0
,
"工单关联的生产版本不允许超报行为"
);
taskQuantityWaitConst
.
compareTo
(
feedbackQualifyConst
.
add
(
fuantityUnqualify
)
)
<
0
,
"工单关联的生产版本不允许超报行为"
);
}
}
}
}
}
}
// 查看当前工单已报工数量
//本次合格数和不合格数总和大于可报工数目 与 已报工数目已经超过了排产数量
if
(
proWorkorders
.
size
()
==
1
)
{
if
((
feedbackQualityDouConst
+
fuantityUnqualify
.
doubleValue
())>=
task
.
getQuantityWait
().
doubleValue
()
&&
task
.
getQuantity
().
doubleValue
()
<=
(
execQuantityQualifySumConst
+
feedbackQualityDouConst
+
fuantityUnqualify
.
doubleValue
()))
{
if
(
feedbackQualityDouConst
>=
task
.
getQuantity
().
doubleValue
()
||
taskQuantityWaitDouConst
==
0
)
{
taskWorkunit
.
setStatus
(
FINISHED
.
getStatus
());
taskWorkunit
.
setStatus
(
FINISHED
.
getStatus
());
}
// 判断已经报工数和未报工数
if
(
execQuantityQualifySumConst
>=
0
)
{
// 第一次进入
if
(
maxWorkunitQuantityConst
>
execQuantityQualifySumConst
)
{
// 工单大于已报工数量 工单减去已报工数量
feedbackQualityVal
=
new
BigDecimal
(
maxWorkunitQuantityConst
-
execQuantityQualifySumConst
);
// 报工数量大于可报工数量取报工数量
if
(
feedbackQualityVal
.
doubleValue
()
>
feedbackQualityDouConst
)
{
feedbackQualityVal
=
feedbackQualifyConst
;
}
}
else
{
feedbackQualityVal
=
BigDecimal
.
valueOf
(
Math
.
min
(
maxWorkunitQuantityConst
,
feedbackQualityDouConst
));
}
}
quantityWaitVal
=
taskQuantityWaitConst
.
subtract
(
feedbackQualityVal
);
}
}
quantityWaitVal
=
taskQuantityWaitConst
.
subtract
(
feedbackQualityVal
.
add
(
fuantityUnqualify
));
task
.
setQuantityWait
(
quantityWaitVal
.
doubleValue
()
<
0
D
?
BigDecimal
.
ZERO
:
quantityWaitVal
);
task
.
setQuantityWait
(
quantityWaitVal
);
task
.
setQuantityProduced
(
DataUtil
.
getNormalData
(
task
.
getQuantityProduced
()).
add
(
feedbackQualityVal
));
task
.
setQuantityProduced
(
DataUtil
.
getNormalData
(
task
.
getQuantityProduced
()).
add
(
feedbackQualityVal
)
.
add
(
fuantityUnqualify
)
);
task
.
setQuantityQualify
(
DataUtil
.
getNormalData
(
task
.
getQuantityQualify
()).
add
(
feedbackQualityVal
));
task
.
setQuantityQualify
(
DataUtil
.
getNormalData
(
task
.
getQuantityQualify
()).
add
(
feedbackQualityVal
));
taskWorkunit
.
setQuantityProduced
(
DataUtil
.
getNormalData
(
taskWorkunit
.
getQuantityProduced
()).
add
(
feedbackQualityVal
));
taskWorkunit
.
setQuantityProduced
(
DataUtil
.
getNormalData
(
taskWorkunit
.
getQuantityProduced
()).
add
(
feedbackQualityVal
)
.
add
(
fuantityUnqualify
)
);
taskWorkunit
.
setQuantityQualify
(
DataUtil
.
getNormalData
(
taskWorkunit
.
getQuantityQualify
()).
add
(
feedbackQualityVal
));
taskWorkunit
.
setQuantityQualify
(
DataUtil
.
getNormalData
(
taskWorkunit
.
getQuantityQualify
()).
add
(
feedbackQualityVal
));
...
...
mes/src/main/resources/mapper/pro/productionSolution/ProProductionSolutionProcessMapper.xml
View file @
a7f84ce3
...
@@ -92,7 +92,8 @@
...
@@ -92,7 +92,8 @@
ppsp.sacm_for_molar_tooth,
ppsp.sacm_for_molar_tooth,
ppsp.sacm_for_slitting,
ppsp.sacm_for_slitting,
pro.process_code, pro.process_name,
pro.process_code, pro.process_name,
pro.process_id
pro.process_id,
ppsp.unit_price
from pro_production_solution_process ppsp
from pro_production_solution_process ppsp
left join pro_process pro on pro.process_id = ppsp.process_id
left join pro_process pro on pro.process_id = ppsp.process_id
left join md_workstation mw on ppsp.workstation_id = mw.workstation_id
left join md_workstation mw on ppsp.workstation_id = mw.workstation_id
...
@@ -162,6 +163,7 @@
...
@@ -162,6 +163,7 @@
<if
test=
"sacmForThermalSelfFusion != null"
>
sacm_for_thermal_self_fusion,
</if>
<if
test=
"sacmForThermalSelfFusion != null"
>
sacm_for_thermal_self_fusion,
</if>
<if
test=
"sacmForMolarTooth != null"
>
sacm_for_molar_tooth,
</if>
<if
test=
"sacmForMolarTooth != null"
>
sacm_for_molar_tooth,
</if>
<if
test=
"sacmForSlitting != null"
>
sacm_for_slitting,
</if>
<if
test=
"sacmForSlitting != null"
>
sacm_for_slitting,
</if>
<if
test=
"unitPrice != null"
>
unit_price,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"productionSolutionId != null"
>
#{productionSolutionId},
</if>
<if
test=
"productionSolutionId != null"
>
#{productionSolutionId},
</if>
...
@@ -202,6 +204,7 @@
...
@@ -202,6 +204,7 @@
<if
test=
"sacmForThermalSelfFusion != null"
>
#{sacmForThermalSelfFusion},
</if>
<if
test=
"sacmForThermalSelfFusion != null"
>
#{sacmForThermalSelfFusion},
</if>
<if
test=
"sacmForMolarTooth != null"
>
#{sacmForMolarTooth},
</if>
<if
test=
"sacmForMolarTooth != null"
>
#{sacmForMolarTooth},
</if>
<if
test=
"sacmForSlitting != null"
>
#{sacmForSlitting},
</if>
<if
test=
"sacmForSlitting != null"
>
#{sacmForSlitting},
</if>
<if
test=
"unitPrice != null"
>
#{unitPrice},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -246,6 +249,7 @@
...
@@ -246,6 +249,7 @@
<if
test=
"sacmForThermalSelfFusion != null"
>
sacm_for_thermal_self_fusion = #{sacmForThermalSelfFusion},
</if>
<if
test=
"sacmForThermalSelfFusion != null"
>
sacm_for_thermal_self_fusion = #{sacmForThermalSelfFusion},
</if>
<if
test=
"sacmForMolarTooth != null"
>
sacm_for_molar_tooth = #{sacmForMolarTooth},
</if>
<if
test=
"sacmForMolarTooth != null"
>
sacm_for_molar_tooth = #{sacmForMolarTooth},
</if>
<if
test=
"sacmForSlitting != null"
>
sacm_for_slitting = #{sacmForSlitting},
</if>
<if
test=
"sacmForSlitting != null"
>
sacm_for_slitting = #{sacmForSlitting},
</if>
<if
test=
"unitPrice != null"
>
unit_price = #{unitPrice},
</if>
</trim>
</trim>
where production_solution_process_id = #{productionSolutionProcessId}
where production_solution_process_id = #{productionSolutionProcessId}
</update>
</update>
...
...
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