From 3eaf0f2f1b909ac429cac9fc26af767ddecda065 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期三, 22 十月 2025 18:54:17 +0800
Subject: [PATCH] 上片接口返回信息国际化,添加定时任务线程池配置类
---
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
index 1462b10..e21a75b 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
@@ -10,13 +10,16 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.MessageSource;
+import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
import java.util.List;
/**
* <p>
- * 鍓嶇鎺у埗鍣�
+ * 鍓嶇鎺у埗鍣�
* </p>
*
* @author zhoush
@@ -30,11 +33,15 @@
@Autowired
private UpPattenUsageService upPattenUsageService;
@Autowired
- private GlassInfoService glassInfoService;
+ private GlassInfoService glassInfoService;
@Autowired
- private EngineeringService engineeringService;
+ private EngineeringService engineeringService;
@Autowired
private OptimizeProjectService optimizeProjectService;
+
+ // 鍥介檯璇█搴�
+ @Resource
+ private MessageSource messageSource;
@ApiOperation("鏄剧ず閫夋嫨鐨勫伐绋嬩俊鎭�")
@@ -66,7 +73,7 @@
return Result.build(100, "澶辫触", upPattenUsages);
}
- }
+ }
@ApiOperation("鍒囨崲鍘熺墖涓婄墖鐘舵��")
@PostMapping("/updateGlassState") //鏌ヨ鐜板湪涓婄墖鏈虹殑鐜荤拑淇℃伅
@@ -94,5 +101,37 @@
}
}
+
+ @ApiOperation("娣诲姞浠诲姟")
+ @PostMapping("/insertTask")
+ public Result insertTask(Integer quantity, Integer slot) {
+ Boolean result = upPattenUsageService.insertTask(quantity, slot);
+ String successMsg = messageSource.getMessage(
+ "rawglass.success",
+ null,
+ LocaleContextHolder.getLocale()
+ );
+ if (result) {
+ return Result.build(200, successMsg, true);
+ } else {
+ return Result.build(500, "fail", false);
+ }
+ }
+
+ @ApiOperation("鍒犻櫎浠诲姟")
+ @PostMapping("/deleteTask")
+ public Result deleteUpPattenTask(String id) {
+ Boolean result = upPattenUsageService.deleteUpPattenTask(id);
+ String successMsg = messageSource.getMessage(
+ "rawglass.delete.success",
+ null,
+ LocaleContextHolder.getLocale()
+ );
+ if (result) {
+ return Result.build(200, successMsg, true);
+ } else {
+ return Result.build(500, "fail", false);
+ }
+ }
}
--
Gitblit v1.8.0