Commit 320e3b5e zshaohui

1.清空出料口30s内不允许重复提交

1 个父辈 45c7ac07
......@@ -617,7 +617,7 @@ public class JkemController {
String newBarcodeStr = "";
while (true) {
newBarcodeStr = generateSecureTimeBasedRandom(7);
newBarcodeStr = generateSecureTimeBasedRandom(5);
Barcode dbBarcode = barcodeManager.findByBarcode(newBarcodeStr);
if (dbBarcode == null) {
break;
......
......@@ -30,6 +30,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@Slf4j
......@@ -77,12 +78,22 @@ public class StorageExportController {
Map<String,Long> cacheClearMap = new ConcurrentHashMap<>();
@ApiOperation("清空出料口")
@RequestMapping("/clearExport")
@AnonymousAccess
public ResultBean clearExport(String export, String feeder) {
public synchronized ResultBean clearExport(String export, String feeder) {
log.info("收到清空出料口信息:" + export + ",feeder为:" + feeder);
Long lastRequestTime = cacheClearMap.get(export);
if (lastRequestTime != null){
if (System.currentTimeMillis() - lastRequestTime <= 1000 * 30){
return ResultBean.newErrorResult(-1,"smf.core.requestLimit","请求频繁,请稍后再试");
}
}
cacheClearMap.put(export,System.currentTimeMillis());
List<DataLog> needCancelTask = new ArrayList<>();
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog dataLog : allTasks) {
......
......@@ -408,4 +408,5 @@ smfcore.order.quantityAfterIssuance=\u56DE\u5E93\u540E\u6570\u91CF
smfcore.order.lackOfQuantity=\u7F3A\u5C11\u6570\u91CF
smfcore.barcode.noMatchFeeder=\u51FA\u6599\u53E3feeder[{0}]\u4E0E\u5F53\u524D\u7269\u6599feeder[{1}]\u4E0D\u5339\u914D
smf.barcode.msd.noMsdvalidate=\u8BE5\u7269\u6599\u4E0D\u9700\u8981MSD\u7BA1\u63A7\u4E0D\u80FD\u5728\u672C\u6599\u4ED3\u5165\u5E93
smfcore.storagePos.lock=\u662F\u5426\u9501\u5B9A
\ No newline at end of file
smfcore.storagePos.lock=\u662F\u5426\u9501\u5B9A
smf.core.requestLimit=\u8BF7\u6C42\u9891\u7E41,\u8BF7\u7A0D\u540E\u518D\u8BD5
\ No newline at end of file
......@@ -398,4 +398,5 @@ smfcore.order.quantityAfterIssuance =Remaining quantity after issuance
smfcore.order.lackOfQuantity=Insufficient Quantity
smfcore.barcode.noMatchFeeder=The feeder [{0}] at the outlet does not match the current material feeder [{1}]
smf.barcode.msd.noMsdvalidate=This material is not MSD-controlled and cannot be stored in this warehouse
smfcore.storagePos.lock=Whether to lock
\ No newline at end of file
smfcore.storagePos.lock=Whether to lock
smf.core.requestLimit=Too Many Requests. Please Try Again Later
\ No newline at end of file
......@@ -394,4 +394,5 @@ smfcore.order.quantityAfterIssuance=\u51FA\u5EAB\u5F8C\u306E\u6570\u91CF
smfcore.order.lackOfQuantity=\u6570\u91CF\u4E0D\u8DB3
smfcore.barcode.noMatchFeeder=\u51FA\u529B\u53E3\u306E\u30D5\u30A3\u30FC\u30C0\u30FC[{0}]\u304C\u73FE\u5728\u306E\u6750\u6599\u30D5\u30A3\u30FC\u30C0\u30FC[{1}]\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093
smf.barcode.msd.noMsdvalidate=\u3053\u306E\u90E8\u54C1\u306FMSD\u7BA1\u7406\u5BFE\u8C61\u5916\u306E\u305F\u3081\u3001\u3053\u306E\u5009\u5EAB\u306B\u306F\u5165\u5EAB\u3067\u304D\u307E\u305B\u3093
smfcore.storagePos.lock = \u30ED\u30C3\u30AF\u3059\u308B\u304B\u3069\u3046\u304B
\ No newline at end of file
smfcore.storagePos.lock = \u30ED\u30C3\u30AF\u3059\u308B\u304B\u3069\u3046\u304B
smf.core.requestLimit = \u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u983B\u7E41\u3067\u3059\u3002\u5F8C\u3067\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044
\ No newline at end of file
......@@ -394,4 +394,5 @@ smfcore.order.quantityAfterIssuance=\u56DE\u5E93\u540E\u6570\u91CF
smfcore.order.lackOfQuantity=\u7F3A\u5C11\u6570\u91CF
smfcore.barcode.noMatchFeeder=\u51FA\u6599\u53E3feeder[{0}]\u4E0E\u5F53\u524D\u7269\u6599feeder[{1}]\u4E0D\u5339\u914D
smf.barcode.msd.noMsdvalidate=\u8BE5\u7269\u6599\u4E0D\u9700\u8981MSD\u7BA1\u63A7\u4E0D\u80FD\u5728\u672C\u6599\u4ED3\u5165\u5E93
smfcore.storagePos.lock=\u662F\u5426\u9501\u5B9A
\ No newline at end of file
smfcore.storagePos.lock=\u662F\u5426\u9501\u5B9A
smf.core.requestLimit=\u8BF7\u6C42\u9891\u7E41,\u8BF7\u7A0D\u540E\u518D\u8BD5
\ No newline at end of file
......@@ -394,4 +394,5 @@ smfcore.order.quantityAfterIssuance=\u56DE\u5EAB\u5F8C\u6578\u91CF
smfcore.order.lackOfQuantity=\u7F3A\u5C11\u6578\u91CF
smfcore.barcode.noMatchFeeder=\u51FA\u6599\u53E3feeder[{0}]\u8207\u7576\u524D\u7269\u6599feeder[{1}]\u4E0D\u5339\u914D
smf.barcode.msd.noMsdvalidate=\u8A72\u7269\u6599\u4E0D\u9700\u8981MSD\u7BA1\u63A7\uFF0C\u4E0D\u80FD\u5728\u672C\u6599\u5009\u5165\u5EAB
smfcore.storagePos.lock = \u662F\u5426\u9396\u5B9A
\ No newline at end of file
smfcore.storagePos.lock = \u662F\u5426\u9396\u5B9A
smf.core.requestLimit = \u8ACB\u6C42\u983B\u7E41\uFF0C\u8ACB\u7A0D\u5F8C\u518D\u8A66
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!