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
41f11e9b
Commit
41f11e9b
authored
May 19, 2026
by
chicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报工防重复提交
parent
8337b5cc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
0 deletions
+42
-0
messages.properties
admin/src/main/resources/i18n/messages.properties
+1
-0
messages_en.properties
admin/src/main/resources/i18n/messages_en.properties
+1
-0
messages_th.properties
admin/src/main/resources/i18n/messages_th.properties
+1
-0
messages_zh_CN.properties
admin/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
Constants.java
...on/src/main/java/com/ximai/common/constant/Constants.java
+5
-0
ProTaskMobController.java
...ximai/mes/pro/controller/mobile/ProTaskMobController.java
+2
-0
ProTaskServiceImpl.java
...m/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
+31
-0
No files found.
admin/src/main/resources/i18n/messages.properties
View file @
41f11e9b
...
...
@@ -206,6 +206,7 @@ pro.feedback.error.serialNo.not.bind.workOrder=\u5E8F\u5217\u53F7\u4E0D\u5C5E\u6
pro.feedback.error.min.quantity=
\u
62A5
\u
5DE5
\u6570\u
91CF
\u
4E0D
\u
80FD
\u
5C0F
\u
4E8E
\u
7B49
\u
4E8E0
pro.feedback.error.quantity.lack=
\u
53EF
\u
62A5
\u
5DE5
\u6570\u
91CF
\u
4E0D
\u
8DB3
pro.feedback.error.before.start=
\u
8BF7
\u5148\u
8FDB
\u
884C
\u
5F00
\u
59CB
\u
4F5C
\u
4E1A
\u
64CD
\u
4F5C
pro.feedback.error.repeat.submit=
\u
62A5
\u
5DE5
\u5904\u7406\u
4E2D
\u
FF0C
\u
8BF7
\u
52FF
\u
91CD
\u
590D
\u
63D0
\u
4EA4
pro.feedback.error.not.find.start=
\u6392\u
4EA7
\u
4EFB
\u
52A1
\u
6CA1
\u6709\u
5F00
\u
5DE5
\u
8BB0
\u
5F55
pro.feedback.error.cannot.delete.last.process=
\u6700\u
540E
\u
4E00
\u9053\u
5DE5
\u
5E8F
\u
62A5
\u
5DE5
\u
65E0
\u
6CD5
\u
4FEE
\u6539\u6216\u8005\u5220\u9664
pro.feedback.error.error1=
\u
4E0B
\u
4E00
\u9053\u
5DE5
\u
5E8F
\u
53EF
\u
64A4
\u
56DE
\u7684\u6570\u
91CF
\u
4E0D
\u
591F
...
...
admin/src/main/resources/i18n/messages_en.properties
View file @
41f11e9b
...
...
@@ -196,6 +196,7 @@ pro.feedback.error.serialNo.not.bind.workOrder=The serial number does not belong
pro.feedback.error.min.quantity=The reported quantity cannot be less than or equal to 0.
pro.feedback.error.quantity.lack=Insufficient quantity available for reporting.
pro.feedback.error.before.start=Please perform start operation first.
pro.feedback.error.repeat.submit=Feedback is being processed, please do not submit again.
pro.feedback.error.not.find.start=There is no start record for the production scheduling task.
pro.feedback.error.cannot.delete.last.process=The reporting of the last process cannot be modified or deleted.
pro.feedback.error.error1=The quantity that can be withdrawn in the next process is insufficient.
...
...
admin/src/main/resources/i18n/messages_th.properties
View file @
41f11e9b
...
...
@@ -203,6 +203,7 @@ pro.feedback.error.serialno.not.bind.workOrder=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0
pro.feedback.error.min.quantity
=
\u
0E08
\u
0E4D
\u
0E32
\u
0E19
\u
0E27
\u
0E19
\u
0E07
\u
0E32
\u
0E19
\u
0E15
\u
0E49
\u
0E2D
\u
0E07
\u
0E44
\u
0E21
\u
0E48
\u
0E19
\u
0E49
\u
0E2D
\u
0E22
\u
0E01
\u
0E27
\u
0E48
\u
0E32
\u
0E2B
\u
0E23
\u
0E37
\u
0E2D
\u
0E40
\u
0E17
\u
0E48
\u
0E32
\u
0E01
\u
0E31
\u
0E1A0
pro.feedback.error.quantity.lack
=
\u
0E08
\u
0E4D
\u
0E32
\u
0E19
\u
0E27
\u
0E19
\u
0E07
\u
0E32
\u
0E19
\u
0E17
\u
0E35
\u
0E48
\u
0E2A
\u
0E32
\u
0E21
\u
0E32
\u
0E23
\u
0E16
\u
0E23
\u
0E32
\u
0E22
\u
0E07
\u
0E32
\u
0E19
\u
0E44
\u
0E14
\u
0E49
\u
0E44
\u
0E21
\u
0E48
\u
0E40
\u
0E1E
\u
0E35
\u
0E22
\u
0E07
\u
0E1E
\u
0E2D
pro.feedback.error.before.start
=
\u
0E42
\u
0E1B
\u
0E23
\u
0E14
\u
0E40
\u
0E23
\u
0E34
\u
0E48
\u
0E21
\u
0E07
\u
0E32
\u
0E19
\u
0E01
\u
0E48
\u
0E2D
\u
0E19
pro.feedback.error.repeat.submit
=
\u
0E01
\u
0E33
\u
0E25
\u
0E31
\u
0E07
\u
0E14
\u
0E33
\u
0E40
\u
0E19
\u
0E34
\u
0E19
\u
0E01
\u
0E32
\u
0E23
\u
0E41
\u
0E08
\u
0E49
\u
0E07
\u
0E40
\u
0E15
\u
0E37
\u
0E2D
\u
0E19
\u
0E01
\u
0E23
\u
0E38
\u
0E13
\u
0E32
\u
0E2D
\u
0E22
\u
0E48
\u
0E32
\u
0E2A
\u
0E48
\u
0E07
\u
0E0B
\u
0E49
\u
0E33
pro.feedback.error.not.find.start
=
\u
0E44
\u
0E21
\u
0E48
\u
0E21
\u
0E35
\u
0E1A
\u
0E31
\u
0E19
\u
0E17
\u
0E36
\u
0E01
\u
0E01
\u
0E32
\u
0E23
\u
0E40
\u
0E23
\u
0E34
\u
0E48
\u
0E21
\u
0E15
\u
0E49
\u
0E19
\u
0E07
\u
0E32
\u
0E19
pro.feedback.error.canot.delete.last.process
=
\u
0E44
\u
0E21
\u
0E48
\u
0E2A
\u
0E32
\u
0E21
\u
0E32
\u
0E23
\u
0E16
\u
0E41
\u
0E01
\u
0E49
\u
0E44
\u
0E02
\u
0E2B
\u
0E23
\u
0E37
\u
0E2D
\u
0E25
\u
0E1A
\u
0E01
\u
0E23
\u
0E30
\u
0E1A
\u
0E27
\u
0E19
\u
0E01
\u
0E32
\u
0E23
\u
0E2A
\u
0E38
\u
0E14
\u
0E17
\u
0E49
\u
0E32
\u
0E22
\u
0E44
\u
0E14
\u
0E49
pro.feedback.error.error1
=
\u
0E08
\u
0E4D
\u
0E32
\u
0E19
\u
0E27
\u
0E19
\u
0E17
\u
0E35
\u
0E48
\u
0E2A
\u
0E32
\u
0E21
\u
0E32
\u
0E23
\u
0E16
\u
0E40
\u
0E1E
\u
0E34
\u
0E01
\u
0E16
\u
0E2D
\u
0E19
\u
0E44
\u
0E14
\u
0E49
\u
0E43
\u
0E19
\u
0E02
\u
0E31
\u
0E49
\u
0E19
\u
0E15
\u
0E2D
\u
0E19
\u
0E16
\u
0E31
\u
0E14
\u
0E44
\u
0E1B
...
...
admin/src/main/resources/i18n/messages_zh_CN.properties
View file @
41f11e9b
...
...
@@ -199,6 +199,7 @@ pro.feedback.error.serialNo.not.bind.workOrder=\u5E8F\u5217\u53F7\u4E0D\u5C5E\u6
pro.feedback.error.min.quantity=
\u
62A5
\u
5DE5
\u6570\u
91CF
\u
4E0D
\u
80FD
\u
5C0F
\u
4E8E
\u
7B49
\u
4E8E0
pro.feedback.error.quantity.lack=
\u
53EF
\u
62A5
\u
5DE5
\u6570\u
91CF
\u
4E0D
\u
8DB3
pro.feedback.error.before.start=
\u
8BF7
\u5148\u
8FDB
\u
884C
\u
5F00
\u
59CB
\u
4F5C
\u
4E1A
\u
64CD
\u
4F5C
pro.feedback.error.repeat.submit=
\u
62A5
\u
5DE5
\u5904\u7406\u
4E2D
\u
FF0C
\u
8BF7
\u
52FF
\u
91CD
\u
590D
\u
63D0
\u
4EA4
pro.feedback.error.not.find.start=
\u6392\u
4EA7
\u
4EFB
\u
52A1
\u
6CA1
\u6709\u
5F00
\u
5DE5
\u
8BB0
\u
5F55
pro.feedback.error.cannot.delete.last.process=
\u6700\u
540E
\u
4E00
\u9053\u
5DE5
\u
5E8F
\u
62A5
\u
5DE5
\u
65E0
\u
6CD5
\u
4FEE
\u6539\u6216\u8005\u5220\u9664
pro.feedback.error.error1=
\u
4E0B
\u
4E00
\u9053\u
5DE5
\u
5E8F
\u
53EF
\u
64A4
\u
56DE
\u7684\u6570\u
91CF
\u
4E0D
\u
591F
...
...
common/src/main/java/com/ximai/common/constant/Constants.java
View file @
41f11e9b
...
...
@@ -71,6 +71,11 @@ public class Constants {
*/
public
static
final
String
REPEAT_SUBMIT_KEY
=
"repeat_submit:"
;
/**
* 生产报工分布式锁 redis key
*/
public
static
final
String
PRO_FEEDBACK_LOCK_KEY
=
"pro_feedback_lock:"
;
/**
* 限流 redis key
*/
...
...
mes/src/main/java/com/ximai/mes/pro/controller/mobile/ProTaskMobController.java
View file @
41f11e9b
...
...
@@ -7,6 +7,7 @@ import cn.hutool.core.io.unit.DataUnit;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.annotation.Log
;
import
com.ximai.common.annotation.RepeatSubmit
;
import
com.ximai.common.core.controller.BaseController
;
import
com.ximai.common.core.domain.AjaxResult
;
import
com.ximai.common.core.page.TableDataInfo
;
...
...
@@ -229,6 +230,7 @@ public class ProTaskMobController extends BaseController {
@ApiOperation
(
"生产报工"
)
@Log
(
title
=
"生产报工"
,
businessType
=
BusinessType
.
INSERT
)
@RepeatSubmit
(
interval
=
5000
)
@PostMapping
(
"/feedback"
)
@ResponseBody
public
AjaxResult
<
List
<
ProPackagePrintResult
>>
feedBack
(
ProFeedback
feedback
)
{
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
View file @
41f11e9b
...
...
@@ -4,7 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.StopWatch
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.constant.Constants
;
import
com.ximai.common.constant.UserConstants
;
import
com.ximai.common.core.redis.RedisCache
;
import
com.ximai.common.utils.MessageUtils
;
import
com.ximai.common.utils.SecurityUtils
;
import
com.ximai.common.utils.data.DataUtil
;
...
...
@@ -72,12 +74,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
...
...
@@ -143,6 +148,8 @@ public class ProTaskServiceImpl implements IProTaskService {
@Autowired
private
IProFeedbackService
proFeedbackService
;
@Autowired
private
RedisCache
redisCache
;
@Autowired
private
ProFeedbackMapper
proFeedbackMapper
;
@Resource
private
SysUserMapper
sysUserMapper
;
...
...
@@ -783,6 +790,30 @@ public class ProTaskServiceImpl implements IProTaskService {
@Override
@Transactional
public
List
<
ProPackagePrintResult
>
feedBack
(
ProFeedback
feedback
)
{
ExceptionUtil
.
checkTrueThrowException
(
feedback
.
getTaskWorkunitId
()
==
null
,
MessageUtils
.
message
(
"pro.feedback.error.before.start"
));
String
lockKey
=
Constants
.
PRO_FEEDBACK_LOCK_KEY
+
feedback
.
getTaskWorkunitId
();
Boolean
acquired
=
Boolean
.
TRUE
.
equals
(
redisCache
.
redisTemplate
.
opsForValue
().
setIfAbsent
(
lockKey
,
"1"
,
30
,
TimeUnit
.
SECONDS
));
ExceptionUtil
.
checkTrueThrowException
(!
acquired
,
MessageUtils
.
message
(
"pro.feedback.error.repeat.submit"
));
if
(
TransactionSynchronizationManager
.
isSynchronizationActive
())
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCompletion
(
int
status
)
{
redisCache
.
deleteObject
(
lockKey
);
}
});
return
doFeedBack
(
feedback
);
}
try
{
return
doFeedBack
(
feedback
);
}
finally
{
redisCache
.
deleteObject
(
lockKey
);
}
}
private
List
<
ProPackagePrintResult
>
doFeedBack
(
ProFeedback
feedback
)
{
List
<
ProPackagePrintResult
>
response
=
new
ArrayList
<>();
BigDecimal
feedbackQualifyConst
=
feedback
.
getQuantityQualify
();
BigDecimal
fuantityUnqualify
=
feedback
.
getQuantityUnqualify
();
...
...
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