Compare commits
29 Commits
a9a4e2304c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73ede33466 | ||
|
|
2798133412 | ||
|
|
8ea6894552 | ||
| 6acb7b4b40 | |||
| 21a1d339d5 | |||
| c47da2f443 | |||
| 53f0fcefb4 | |||
| e07387132b | |||
| 1f1397b116 | |||
| 1d0fda5956 | |||
| dc36a0336a | |||
| 173f05f723 | |||
| b09d0a87ad | |||
| ab2f4a611a | |||
| 78e2c3023b | |||
| 609a6e91ef | |||
| 1065c62d0c | |||
| c8350b5f0e | |||
| 75ff7790d8 | |||
| 58efd3841e | |||
| dd70c94dd7 | |||
| 022312d02c | |||
| 7899b31c08 | |||
| 0b02122015 | |||
| 80d33d9a3b | |||
| 91fc8b6e38 | |||
| da2620f17d | |||
| e998261002 | |||
| e2692c68f2 |
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "double-rack",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {}
|
||||
}
|
||||
8
pom.xml
8
pom.xml
@@ -225,6 +225,13 @@
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 成本管理模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-cost</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
@@ -248,6 +255,7 @@
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>ruoyi-mill</module>
|
||||
<module>ruoyi-cost</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
@@ -67,6 +67,25 @@
|
||||
<artifactId>ruoyi-mill</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 成本管理模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-cost</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MinIO 所需的 OkHttp 4.x(覆盖其他依赖传递的 3.x) -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
<!-- OkHttp 4.x 所需的 okio 3.x -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okio</groupId>
|
||||
<artifactId>okio</artifactId>
|
||||
<version>3.6.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.common.utils.file.MinioService;
|
||||
import com.ruoyi.framework.config.ServerConfig;
|
||||
|
||||
/**
|
||||
@@ -35,6 +37,9 @@ public class CommonController
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
@Autowired(required = false)
|
||||
private MinioService minioService;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
/**
|
||||
@@ -53,14 +58,30 @@ public class CommonController
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
if (isMinioEnabled())
|
||||
{
|
||||
FileUtils.deleteFile(filePath);
|
||||
// MinIO 下载
|
||||
String objectName = "download/" + fileName;
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
minioService.download(objectName, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
minioService.delete(objectName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 本地文件系统下载
|
||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
FileUtils.deleteFile(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -77,16 +98,28 @@ public class CommonController
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
|
||||
if (isMinioEnabled())
|
||||
{
|
||||
// MinIO 上传
|
||||
String url = FileUploadUtils.uploadToMinio(minioService, "upload", file,
|
||||
MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", url);
|
||||
ajax.put("newFileName", FileUtils.getName(file.getOriginalFilename()));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 本地文件系统上传
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
}
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -103,22 +136,39 @@ public class CommonController
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
|
||||
if (isMinioEnabled())
|
||||
{
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
// MinIO 上传
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
String url = FileUploadUtils.uploadToMinio(minioService, "upload", file,
|
||||
MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
urls.add(url);
|
||||
fileNames.add(url);
|
||||
newFileNames.add(FileUtils.getName(file.getOriginalFilename()));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 本地文件系统上传
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
}
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
@@ -160,4 +210,12 @@ public class CommonController
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 MinIO 是否启用
|
||||
*/
|
||||
private boolean isMinioEnabled()
|
||||
{
|
||||
return minioService != null && minioService.isInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.ruoyi.common.exception.NonCaptureException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.common.utils.file.MinioService;
|
||||
import com.ruoyi.framework.config.ServerConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -25,26 +27,50 @@ public class FileUploadController {
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
@Autowired(required = false)
|
||||
private MinioService minioService;
|
||||
|
||||
@Anonymous
|
||||
@PostMapping("/upload")
|
||||
@SuppressWarnings("DuplicatedCode")
|
||||
public AjaxResult uploadFile(MultipartFile file) {
|
||||
try {
|
||||
log.info("文件 {} 上传中...", file.getOriginalFilename());
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
|
||||
if (isMinioEnabled())
|
||||
{
|
||||
// MinIO 上传
|
||||
String url = FileUploadUtils.uploadToMinio(minioService, "upload", file,
|
||||
MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", url);
|
||||
ajax.put("newFileName", FileUtils.getName(file.getOriginalFilename()));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 本地文件系统上传
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
}
|
||||
|
||||
log.info("文件 {} 上传成功!", file.getOriginalFilename());
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
throw new NonCaptureException(StringUtils.format("文件 {} 上传失败!", file.getOriginalFilename()), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 MinIO 是否启用
|
||||
*/
|
||||
private boolean isMinioEnabled()
|
||||
{
|
||||
return minioService != null && minioService.isInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.common.utils.file.MinioService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
@@ -39,6 +40,9 @@ public class SysProfileController extends BaseController
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired(required = false)
|
||||
private MinioService minioService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@@ -124,7 +128,15 @@ public class SysProfileController extends BaseController
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
String avatar;
|
||||
if (isMinioEnabled())
|
||||
{
|
||||
avatar = FileUploadUtils.uploadToMinio(minioService, "avatar", file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
}
|
||||
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
@@ -137,4 +149,12 @@ public class SysProfileController extends BaseController
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 MinIO 是否启用
|
||||
*/
|
||||
private boolean isMinioEnabled()
|
||||
{
|
||||
return minioService != null && minioService.isInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ spring:
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 三级 klp-oa 主库(用于查询 WMS 钢卷数据)
|
||||
klp:
|
||||
url: jdbc:mysql://140.143.206.120:13306/klp-oa-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
|
||||
username: klp
|
||||
password: KeLunPu@123
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
|
||||
@@ -13,6 +13,19 @@ ruoyi:
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
# MinIO 对象存储配置(开启后将文件存储到 MinIO 而非本地文件系统)
|
||||
minio:
|
||||
# 是否启用(false 则使用本地文件系统)
|
||||
enabled: true
|
||||
# MinIO 服务地址
|
||||
endpoint: http://140.143.206.120:10900
|
||||
# 访问密钥
|
||||
accessKey: m4X4SsEOhEfTTiv7wI8X
|
||||
# 秘密密钥
|
||||
secretKey: zMCim41ZPlpxP5BtNJ2hS6JvvbpIVOz3fhKaLoLG
|
||||
# 存储桶名称
|
||||
bucketName: double-rack
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
|
||||
@@ -113,6 +113,25 @@
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MinIO 对象存储 -->
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.5.7</version>
|
||||
</dependency>
|
||||
<!-- 覆盖项目中 OkHttp 3.x 为 MinIO 所需的 4.x 版本 -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
<!-- OkHttp 4.x 所需的 okio 3.x -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okio</groupId>
|
||||
<artifactId>okio</artifactId>
|
||||
<version>3.6.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- servlet包 -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.common.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* MinIO 对象存储配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "minio")
|
||||
public class MinioConfig
|
||||
{
|
||||
/** 是否启用 MinIO(false 则使用本地文件系统) */
|
||||
private boolean enabled = false;
|
||||
|
||||
/** MinIO 服务地址 */
|
||||
private String endpoint;
|
||||
|
||||
/** 访问密钥 */
|
||||
private String accessKey;
|
||||
|
||||
/** 秘密密钥 */
|
||||
private String secretKey;
|
||||
|
||||
/** 存储桶名称 */
|
||||
private String bucketName;
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled)
|
||||
{
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getEndpoint()
|
||||
{
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
public void setEndpoint(String endpoint)
|
||||
{
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public String getAccessKey()
|
||||
{
|
||||
return accessKey;
|
||||
}
|
||||
|
||||
public void setAccessKey(String accessKey)
|
||||
{
|
||||
this.accessKey = accessKey;
|
||||
}
|
||||
|
||||
public String getSecretKey()
|
||||
{
|
||||
return secretKey;
|
||||
}
|
||||
|
||||
public void setSecretKey(String secretKey)
|
||||
{
|
||||
this.secretKey = secretKey;
|
||||
}
|
||||
|
||||
public String getBucketName()
|
||||
{
|
||||
return bucketName;
|
||||
}
|
||||
|
||||
public void setBucketName(String bucketName)
|
||||
{
|
||||
this.bucketName = bucketName;
|
||||
}
|
||||
}
|
||||
@@ -15,5 +15,10 @@ public enum DataSourceType
|
||||
/**
|
||||
* 从库
|
||||
*/
|
||||
SLAVE
|
||||
SLAVE,
|
||||
|
||||
/**
|
||||
* 三级 klp-oa 主库
|
||||
*/
|
||||
KLP
|
||||
}
|
||||
|
||||
@@ -214,6 +214,36 @@ public class FileUploadUtils
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到 MinIO(使用与本地文件系统相同的文件名规则)
|
||||
*
|
||||
* @param minioService MinIO 服务实例
|
||||
* @param baseDir 基础目录(如 upload、avatar)
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 允许的文件扩展名
|
||||
* @return MinIO 文件访问 URL
|
||||
* @throws IOException 上传失败
|
||||
*/
|
||||
public static final String uploadToMinio(MinioService minioService, String baseDir, MultipartFile file,
|
||||
String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
// 生成 objectName: upload/2025/04/13/originalName_uuid.ext
|
||||
String fileName = extractFilename(file);
|
||||
String objectName = baseDir + "/" + fileName;
|
||||
|
||||
return minioService.upload(file, objectName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件名的后缀
|
||||
*
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
package com.ruoyi.common.utils.file;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import io.minio.BucketExistsArgs;
|
||||
import io.minio.GetObjectArgs;
|
||||
import io.minio.MakeBucketArgs;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import io.minio.RemoveObjectArgs;
|
||||
import io.minio.StatObjectArgs;
|
||||
import io.minio.errors.ErrorResponseException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.ruoyi.common.config.MinioConfig;
|
||||
|
||||
import io.minio.http.Method;
|
||||
|
||||
/**
|
||||
* MinIO 对象存储服务
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class MinioService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(MinioService.class);
|
||||
|
||||
private MinioClient minioClient;
|
||||
private MinioConfig minioConfig;
|
||||
private volatile boolean initialized = false;
|
||||
|
||||
@Autowired
|
||||
public MinioService(MinioConfig minioConfig)
|
||||
{
|
||||
this.minioConfig = minioConfig;
|
||||
if (!minioConfig.isEnabled())
|
||||
{
|
||||
log.info("MinIO 未启用(minio.enabled=false),跳过初始化");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
this.minioClient = MinioClient.builder()
|
||||
.endpoint(minioConfig.getEndpoint())
|
||||
.credentials(minioConfig.getAccessKey(), minioConfig.getSecretKey())
|
||||
.build();
|
||||
ensureBucketExists();
|
||||
this.initialized = true;
|
||||
log.info("MinIO 客户端初始化成功: endpoint={}, bucket={}",
|
||||
minioConfig.getEndpoint(), minioConfig.getBucketName());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("MinIO 初始化失败(应用将继续运行,上传降级为本地文件系统): {}", e.getMessage());
|
||||
this.minioClient = null;
|
||||
this.initialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查 MinIO 客户端是否已正确初始化
|
||||
*/
|
||||
private void checkInitialized()
|
||||
{
|
||||
if (!initialized || minioClient == null)
|
||||
{
|
||||
throw new IllegalStateException("MinIO 未启用或初始化失败,请检查配置");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确保存储桶存在,不存在则自动创建
|
||||
*/
|
||||
private void ensureBucketExists() throws Exception
|
||||
{
|
||||
String bucketName = minioConfig.getBucketName();
|
||||
if (!minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()))
|
||||
{
|
||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
|
||||
log.info("MinIO 存储桶 [{}] 已自动创建", bucketName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到 MinIO
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @param objectName 对象名称(含路径,如 upload/2025/04/13/xxx.png)
|
||||
* @return 文件访问 URL
|
||||
*/
|
||||
public String upload(MultipartFile file, String objectName) throws IOException
|
||||
{
|
||||
checkInitialized();
|
||||
try
|
||||
{
|
||||
String contentType = file.getContentType() != null ? file.getContentType() : "application/octet-stream";
|
||||
minioClient.putObject(
|
||||
PutObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.stream(file.getInputStream(), file.getSize(), -1)
|
||||
.contentType(contentType)
|
||||
.build());
|
||||
log.info("MinIO 上传成功: {} -> bucket:{}", objectName, minioConfig.getBucketName());
|
||||
return getUrl(objectName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MinIO 上传失败: {}", objectName, e);
|
||||
throw new IOException("MinIO 上传失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传输入流到 MinIO
|
||||
*
|
||||
* @param stream 输入流
|
||||
* @param objectName 对象名称
|
||||
* @param size 数据大小
|
||||
* @param contentType 内容类型
|
||||
* @return 文件访问 URL
|
||||
*/
|
||||
public String upload(InputStream stream, String objectName, long size, String contentType) throws IOException
|
||||
{
|
||||
checkInitialized();
|
||||
try
|
||||
{
|
||||
String ct = (contentType != null) ? contentType : "application/octet-stream";
|
||||
minioClient.putObject(
|
||||
PutObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.stream(stream, size, -1)
|
||||
.contentType(ct)
|
||||
.build());
|
||||
return getUrl(objectName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MinIO 上传失败: {}", objectName, e);
|
||||
throw new IOException("MinIO 上传失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件访问 URL(7天有效期)
|
||||
*
|
||||
* @param objectName 对象名称
|
||||
* @return 预签名 URL
|
||||
*/
|
||||
public String getUrl(String objectName)
|
||||
{
|
||||
checkInitialized();
|
||||
try
|
||||
{
|
||||
return minioClient.getPresignedObjectUrl(
|
||||
io.minio.GetPresignedObjectUrlArgs.builder()
|
||||
.method(Method.GET)
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.expiry(7 * 24 * 60 * 60)
|
||||
.build());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("MinIO 获取 URL 失败: {}", objectName, e);
|
||||
return minioConfig.getEndpoint() + "/" + minioConfig.getBucketName() + "/" + objectName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件到输出流
|
||||
*
|
||||
* @param objectName 对象名称
|
||||
* @param os 输出流
|
||||
*/
|
||||
public void download(String objectName, OutputStream os) throws IOException
|
||||
{
|
||||
checkInitialized();
|
||||
try
|
||||
{
|
||||
try (InputStream is = minioClient.getObject(
|
||||
GetObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.build()))
|
||||
{
|
||||
byte[] buf = new byte[8192];
|
||||
int len;
|
||||
while ((len = is.read(buf)) > -1)
|
||||
{
|
||||
os.write(buf, 0, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MinIO 下载失败: {}", objectName, e);
|
||||
throw new IOException("MinIO 下载失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param objectName 对象名称
|
||||
*/
|
||||
public void delete(String objectName) throws IOException
|
||||
{
|
||||
checkInitialized();
|
||||
try
|
||||
{
|
||||
minioClient.removeObject(
|
||||
RemoveObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.build());
|
||||
log.info("MinIO 删除成功: {}", objectName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MinIO 删除失败: {}", objectName, e);
|
||||
throw new IOException("MinIO 删除失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断对象是否存在
|
||||
*
|
||||
* @param objectName 对象名称
|
||||
* @return true 存在
|
||||
*/
|
||||
public boolean exists(String objectName)
|
||||
{
|
||||
if (!initialized || minioClient == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
minioClient.statObject(
|
||||
StatObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(objectName)
|
||||
.build());
|
||||
return true;
|
||||
}
|
||||
catch (ErrorResponseException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("MinIO 检查对象存在性失败: {}", objectName, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 MinIO 是否已正确初始化并可用
|
||||
*/
|
||||
public boolean isInitialized()
|
||||
{
|
||||
return initialized && minioClient != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 MinIO 配置
|
||||
*/
|
||||
public MinioConfig getMinioConfig()
|
||||
{
|
||||
return minioConfig;
|
||||
}
|
||||
}
|
||||
55
ruoyi-cost/pom.xml
Normal file
55
ruoyi-cost/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.8.9</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>ruoyi-cost</artifactId>
|
||||
|
||||
<description>成本管理业务模块</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 核心框架 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger 注解 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JUnit 测试 -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot Test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.cost.bo;
|
||||
|
||||
import com.ruoyi.cost.domain.CostProdDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产成本明细批量操作参数
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostProdDetailBo
|
||||
{
|
||||
/** 需删除的明细ID列表 */
|
||||
private List<Long> detailIds;
|
||||
|
||||
/** 需保存的明细列表 */
|
||||
private List<CostProdDetail> prodDetailList;
|
||||
|
||||
public List<Long> getDetailIds()
|
||||
{
|
||||
return detailIds;
|
||||
}
|
||||
|
||||
public void setDetailIds(List<Long> detailIds)
|
||||
{
|
||||
this.detailIds = detailIds;
|
||||
}
|
||||
|
||||
public List<CostProdDetail> getProdDetailList()
|
||||
{
|
||||
return prodDetailList;
|
||||
}
|
||||
|
||||
public void setProdDetailList(List<CostProdDetail> prodDetailList)
|
||||
{
|
||||
this.prodDetailList = prodDetailList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cost.domain.CostItem;
|
||||
import com.ruoyi.cost.service.ICostItemService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成本项目配置Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cost/item")
|
||||
public class CostItemController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICostItemService costItemService;
|
||||
|
||||
/**
|
||||
* 查询成本项目配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CostItem costItem)
|
||||
{
|
||||
startPage();
|
||||
List<CostItem> list = costItemService.selectCostItemList(costItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成本项目配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:export')")
|
||||
@Log(title = "成本项目配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CostItem costItem)
|
||||
{
|
||||
List<CostItem> list = costItemService.selectCostItemList(costItem);
|
||||
ExcelUtil<CostItem> util = new ExcelUtil<CostItem>(CostItem.class);
|
||||
util.exportExcel(response, list, "成本项目配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成本项目配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:query')")
|
||||
@GetMapping(value = "/{itemId}")
|
||||
public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
|
||||
{
|
||||
return success(costItemService.selectCostItemByItemId(itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本项目配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:add')")
|
||||
@Log(title = "成本项目配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CostItem costItem)
|
||||
{
|
||||
return toAjax(costItemService.insertCostItem(costItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本项目配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:edit')")
|
||||
@Log(title = "成本项目配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CostItem costItem)
|
||||
{
|
||||
return toAjax(costItemService.updateCostItem(costItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成本项目配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:item:remove')")
|
||||
@Log(title = "成本项目配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{itemIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] itemIds)
|
||||
{
|
||||
return toAjax(costItemService.deleteCostItemByItemIds(itemIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cost.domain.CostPrice;
|
||||
import com.ruoyi.cost.service.ICostPriceService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成本单价历史Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cost/price")
|
||||
public class CostPriceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICostPriceService costPriceService;
|
||||
|
||||
/**
|
||||
* 查询成本单价历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CostPrice costPrice)
|
||||
{
|
||||
startPage();
|
||||
List<CostPrice> list = costPriceService.selectCostPriceList(costPrice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成本单价历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:export')")
|
||||
@Log(title = "成本单价历史", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CostPrice costPrice)
|
||||
{
|
||||
List<CostPrice> list = costPriceService.selectCostPriceList(costPrice);
|
||||
ExcelUtil<CostPrice> util = new ExcelUtil<CostPrice>(CostPrice.class);
|
||||
util.exportExcel(response, list, "成本单价历史数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成本单价历史详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:query')")
|
||||
@GetMapping(value = "/{priceId}")
|
||||
public AjaxResult getInfo(@PathVariable("priceId") Long priceId)
|
||||
{
|
||||
return success(costPriceService.selectCostPriceByPriceId(priceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本单价历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:add')")
|
||||
@Log(title = "成本单价历史", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CostPrice costPrice)
|
||||
{
|
||||
return toAjax(costPriceService.insertCostPrice(costPrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本单价历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:edit')")
|
||||
@Log(title = "成本单价历史", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CostPrice costPrice)
|
||||
{
|
||||
return toAjax(costPriceService.updateCostPrice(costPrice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成本单价历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:price:remove')")
|
||||
@Log(title = "成本单价历史", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{priceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] priceIds)
|
||||
{
|
||||
return toAjax(costPriceService.deleteCostPriceByPriceIds(priceIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cost.domain.CostProdDetail;
|
||||
import com.ruoyi.cost.service.ICostProdDetailService;
|
||||
import com.ruoyi.cost.bo.CostProdDetailBo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产成本明细Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cost/detail")
|
||||
public class CostProdDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICostProdDetailService costProdDetailService;
|
||||
|
||||
/**
|
||||
* 查询生产成本明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CostProdDetail costProdDetail)
|
||||
{
|
||||
startPage();
|
||||
List<CostProdDetail> list = costProdDetailService.selectCostProdDetailList(costProdDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产成本明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:export')")
|
||||
@Log(title = "生产成本明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CostProdDetail costProdDetail)
|
||||
{
|
||||
List<CostProdDetail> list = costProdDetailService.selectCostProdDetailList(costProdDetail);
|
||||
ExcelUtil<CostProdDetail> util = new ExcelUtil<CostProdDetail>(CostProdDetail.class);
|
||||
util.exportExcel(response, list, "生产成本明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产成本明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:query')")
|
||||
@GetMapping(value = "/{detailId}")
|
||||
public AjaxResult getInfo(@PathVariable("detailId") Long detailId)
|
||||
{
|
||||
return success(costProdDetailService.selectCostProdDetailByDetailId(detailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产成本明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:add')")
|
||||
@Log(title = "生产成本明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CostProdDetail costProdDetail)
|
||||
{
|
||||
return toAjax(costProdDetailService.insertCostProdDetail(costProdDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产成本明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:edit')")
|
||||
@Log(title = "生产成本明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CostProdDetail costProdDetail)
|
||||
{
|
||||
return toAjax(costProdDetailService.updateCostProdDetail(costProdDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产成本明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:remove')")
|
||||
@Log(title = "生产成本明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] detailIds)
|
||||
{
|
||||
return toAjax(costProdDetailService.deleteCostProdDetailByDetailIds(detailIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存生产成本明细(先删除再插入)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:detail:add')")
|
||||
@Log(title = "生产成本明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/batchSave")
|
||||
public AjaxResult batchSave(@RequestBody CostProdDetailBo bo)
|
||||
{
|
||||
return toAjax(costProdDetailService.batchSaveWithDelete(bo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cost.domain.CostProdMetric;
|
||||
import com.ruoyi.cost.service.ICostProdMetricService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产指标明细Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cost/metric")
|
||||
public class CostProdMetricController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICostProdMetricService costProdMetricService;
|
||||
|
||||
/**
|
||||
* 查询生产指标明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CostProdMetric costProdMetric)
|
||||
{
|
||||
startPage();
|
||||
List<CostProdMetric> list = costProdMetricService.selectCostProdMetricList(costProdMetric);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产指标明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:export')")
|
||||
@Log(title = "生产指标明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CostProdMetric costProdMetric)
|
||||
{
|
||||
List<CostProdMetric> list = costProdMetricService.selectCostProdMetricList(costProdMetric);
|
||||
ExcelUtil<CostProdMetric> util = new ExcelUtil<CostProdMetric>(CostProdMetric.class);
|
||||
util.exportExcel(response, list, "生产指标明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产指标明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:query')")
|
||||
@GetMapping(value = "/{metricId}")
|
||||
public AjaxResult getInfo(@PathVariable("metricId") Long metricId)
|
||||
{
|
||||
return success(costProdMetricService.selectCostProdMetricByMetricId(metricId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产指标明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:add')")
|
||||
@Log(title = "生产指标明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CostProdMetric costProdMetric)
|
||||
{
|
||||
return toAjax(costProdMetricService.insertCostProdMetric(costProdMetric));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产指标明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:edit')")
|
||||
@Log(title = "生产指标明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CostProdMetric costProdMetric)
|
||||
{
|
||||
return toAjax(costProdMetricService.updateCostProdMetric(costProdMetric));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产指标明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:metric:remove')")
|
||||
@Log(title = "生产指标明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{metricIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] metricIds)
|
||||
{
|
||||
return toAjax(costProdMetricService.deleteCostProdMetricByMetricIds(metricIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cost.domain.CostProdReport;
|
||||
import com.ruoyi.cost.service.ICostProdReportService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产月报Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cost/report")
|
||||
public class CostProdReportController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICostProdReportService costProdReportService;
|
||||
|
||||
/**
|
||||
* 查询生产月报列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CostProdReport costProdReport)
|
||||
{
|
||||
startPage();
|
||||
List<CostProdReport> list = costProdReportService.selectCostProdReportList(costProdReport);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产月报列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:export')")
|
||||
@Log(title = "生产月报", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CostProdReport costProdReport)
|
||||
{
|
||||
List<CostProdReport> list = costProdReportService.selectCostProdReportList(costProdReport);
|
||||
ExcelUtil<CostProdReport> util = new ExcelUtil<CostProdReport>(CostProdReport.class);
|
||||
util.exportExcel(response, list, "生产月报数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产月报详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:query')")
|
||||
@GetMapping(value = "/{reportId}")
|
||||
public AjaxResult getInfo(@PathVariable("reportId") Long reportId)
|
||||
{
|
||||
return success(costProdReportService.selectCostProdReportByReportId(reportId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产月报
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:add')")
|
||||
@Log(title = "生产月报", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CostProdReport costProdReport)
|
||||
{
|
||||
return toAjax(costProdReportService.insertCostProdReport(costProdReport));
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制生产月报
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:add')")
|
||||
@Log(title = "生产月报", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/copy")
|
||||
public AjaxResult copy(@RequestParam Long sourceId, @RequestBody CostProdReport costProdReport)
|
||||
{
|
||||
return success(costProdReportService.copyReport(sourceId, costProdReport));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产月报
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:edit')")
|
||||
@Log(title = "生产月报", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CostProdReport costProdReport)
|
||||
{
|
||||
return toAjax(costProdReportService.updateCostProdReport(costProdReport));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产月报
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cost:report:remove')")
|
||||
@Log(title = "生产月报", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{reportIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] reportIds)
|
||||
{
|
||||
return toAjax(costProdReportService.deleteCostProdReportByReportIds(reportIds));
|
||||
}
|
||||
}
|
||||
131
ruoyi-cost/src/main/java/com/ruoyi/cost/domain/CostItem.java
Normal file
131
ruoyi-cost/src/main/java/com/ruoyi/cost/domain/CostItem.java
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.ruoyi.cost.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成本项目配置对象 cost_item
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostItem extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 成本项目编码 */
|
||||
@Excel(name = "成本项目编码")
|
||||
private String itemCode;
|
||||
|
||||
/** 成本项目名称 */
|
||||
@Excel(name = "成本项目名称")
|
||||
private String itemName;
|
||||
|
||||
/** 成本分类 原料/能耗/辅料/设备/人工 */
|
||||
@Excel(name = "成本分类 原料/能耗/辅料/设备/人工")
|
||||
private String category;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String unit;
|
||||
|
||||
/** 查询条件(JSON格式) */
|
||||
@Excel(name = "查询条件", readConverterExp = "J=SON格式")
|
||||
private String queryCondition;
|
||||
|
||||
/** 删除标识 0=正常 2=删除 */
|
||||
private Long delFlag;
|
||||
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setCategory(String category)
|
||||
{
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getCategory()
|
||||
{
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setQueryCondition(String queryCondition)
|
||||
{
|
||||
this.queryCondition = queryCondition;
|
||||
}
|
||||
|
||||
public String getQueryCondition()
|
||||
{
|
||||
return queryCondition;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("category", getCategory())
|
||||
.append("unit", getUnit())
|
||||
.append("remark", getRemark())
|
||||
.append("queryCondition", getQueryCondition())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
105
ruoyi-cost/src/main/java/com/ruoyi/cost/domain/CostPrice.java
Normal file
105
ruoyi-cost/src/main/java/com/ruoyi/cost/domain/CostPrice.java
Normal file
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.cost.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成本单价历史对象 cost_price
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostPrice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long priceId;
|
||||
|
||||
/** 成本项目ID */
|
||||
@Excel(name = "成本项目ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生效日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 删除标识 0=正常 2=删除 */
|
||||
private Long delFlag;
|
||||
|
||||
public void setPriceId(Long priceId)
|
||||
{
|
||||
this.priceId = priceId;
|
||||
}
|
||||
|
||||
public Long getPriceId()
|
||||
{
|
||||
return priceId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setEffectiveDate(Date effectiveDate)
|
||||
{
|
||||
this.effectiveDate = effectiveDate;
|
||||
}
|
||||
|
||||
public Date getEffectiveDate()
|
||||
{
|
||||
return effectiveDate;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("priceId", getPriceId())
|
||||
.append("itemId", getItemId())
|
||||
.append("price", getPrice())
|
||||
.append("effectiveDate", getEffectiveDate())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.ruoyi.cost.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产成本明细对象 cost_prod_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostProdDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long detailId;
|
||||
|
||||
/** 生产月报ID */
|
||||
@Excel(name = "生产月报ID")
|
||||
private Long reportId;
|
||||
|
||||
/** 班次 1=甲班 2=乙班 */
|
||||
@Excel(name = "班次 1=甲班 2=乙班")
|
||||
private String shift;
|
||||
|
||||
/** 日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date detailDate;
|
||||
|
||||
/** 成本项目ID */
|
||||
@Excel(name = "成本项目ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 消耗用量 */
|
||||
@Excel(name = "消耗用量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总金额 */
|
||||
@Excel(name = "总金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 删除标识 0=正常 2=删除 */
|
||||
private Long delFlag;
|
||||
|
||||
public void setDetailId(Long detailId)
|
||||
{
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public Long getDetailId()
|
||||
{
|
||||
return detailId;
|
||||
}
|
||||
|
||||
public void setReportId(Long reportId)
|
||||
{
|
||||
this.reportId = reportId;
|
||||
}
|
||||
|
||||
public Long getReportId()
|
||||
{
|
||||
return reportId;
|
||||
}
|
||||
|
||||
public void setShift(String shift)
|
||||
{
|
||||
this.shift = shift;
|
||||
}
|
||||
|
||||
public String getShift()
|
||||
{
|
||||
return shift;
|
||||
}
|
||||
|
||||
public void setDetailDate(Date detailDate)
|
||||
{
|
||||
this.detailDate = detailDate;
|
||||
}
|
||||
|
||||
public Date getDetailDate()
|
||||
{
|
||||
return detailDate;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setUnitPrice(BigDecimal unitPrice)
|
||||
{
|
||||
this.unitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPrice()
|
||||
{
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("detailId", getDetailId())
|
||||
.append("reportId", getReportId())
|
||||
.append("shift", getShift())
|
||||
.append("detailDate", getDetailDate())
|
||||
.append("itemId", getItemId())
|
||||
.append("quantity", getQuantity())
|
||||
.append("unitPrice", getUnitPrice())
|
||||
.append("amount", getAmount())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.cost.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产指标明细对象 cost_prod_metric
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostProdMetric extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long metricId;
|
||||
|
||||
/** 生产日报ID */
|
||||
@Excel(name = "生产日报ID")
|
||||
private Long reportId;
|
||||
|
||||
/** 指标编码 */
|
||||
@Excel(name = "指标编码")
|
||||
private String metricCode;
|
||||
|
||||
/** 指标名称 */
|
||||
@Excel(name = "指标名称")
|
||||
private String metricName;
|
||||
|
||||
/** 指标计算公式(如:output_weight/input_weight*100) */
|
||||
@Excel(name = "指标计算公式", readConverterExp = "如=:output_weight/input_weight*100")
|
||||
private String metricFormula;
|
||||
|
||||
/** 指标计算结果值 */
|
||||
@Excel(name = "指标计算结果值")
|
||||
private BigDecimal metricValue;
|
||||
|
||||
/** 删除标识 0=正常 2=删除 */
|
||||
private Long delFlag;
|
||||
|
||||
public void setMetricId(Long metricId)
|
||||
{
|
||||
this.metricId = metricId;
|
||||
}
|
||||
|
||||
public Long getMetricId()
|
||||
{
|
||||
return metricId;
|
||||
}
|
||||
|
||||
public void setReportId(Long reportId)
|
||||
{
|
||||
this.reportId = reportId;
|
||||
}
|
||||
|
||||
public Long getReportId()
|
||||
{
|
||||
return reportId;
|
||||
}
|
||||
|
||||
public void setMetricCode(String metricCode)
|
||||
{
|
||||
this.metricCode = metricCode;
|
||||
}
|
||||
|
||||
public String getMetricCode()
|
||||
{
|
||||
return metricCode;
|
||||
}
|
||||
|
||||
public void setMetricName(String metricName)
|
||||
{
|
||||
this.metricName = metricName;
|
||||
}
|
||||
|
||||
public String getMetricName()
|
||||
{
|
||||
return metricName;
|
||||
}
|
||||
|
||||
public void setMetricFormula(String metricFormula)
|
||||
{
|
||||
this.metricFormula = metricFormula;
|
||||
}
|
||||
|
||||
public String getMetricFormula()
|
||||
{
|
||||
return metricFormula;
|
||||
}
|
||||
|
||||
public void setMetricValue(BigDecimal metricValue)
|
||||
{
|
||||
this.metricValue = metricValue;
|
||||
}
|
||||
|
||||
public BigDecimal getMetricValue()
|
||||
{
|
||||
return metricValue;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("metricId", getMetricId())
|
||||
.append("reportId", getReportId())
|
||||
.append("metricCode", getMetricCode())
|
||||
.append("metricName", getMetricName())
|
||||
.append("metricFormula", getMetricFormula())
|
||||
.append("metricValue", getMetricValue())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.ruoyi.cost.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产月报对象 cost_prod_report
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class CostProdReport extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long reportId;
|
||||
|
||||
/** 报表标题 */
|
||||
@Excel(name = "报表标题")
|
||||
private String reportTitle;
|
||||
|
||||
/** 报表日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报表日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reportDate;
|
||||
|
||||
/** 产线类型 acid=酸轧 galvanized=镀锌 */
|
||||
@Excel(name = "产线类型 acid=酸轧 galvanized=镀锌")
|
||||
private String lineType;
|
||||
|
||||
/** 投入量 单位:吨 */
|
||||
@Excel(name = "投入量 单位:吨")
|
||||
private BigDecimal inputWeight;
|
||||
|
||||
/** 产出量 单位:吨 */
|
||||
@Excel(name = "产出量 单位:吨")
|
||||
private BigDecimal outputWeight;
|
||||
|
||||
/** 删除标识 0=正常 2=删除 */
|
||||
private Long delFlag;
|
||||
|
||||
/** 表格配置 */
|
||||
@Excel(name = "表格配置")
|
||||
private String colConfig;
|
||||
|
||||
public void setReportId(Long reportId)
|
||||
{
|
||||
this.reportId = reportId;
|
||||
}
|
||||
|
||||
public Long getReportId()
|
||||
{
|
||||
return reportId;
|
||||
}
|
||||
|
||||
public void setReportTitle(String reportTitle)
|
||||
{
|
||||
this.reportTitle = reportTitle;
|
||||
}
|
||||
|
||||
public String getReportTitle()
|
||||
{
|
||||
return reportTitle;
|
||||
}
|
||||
|
||||
public void setReportDate(Date reportDate)
|
||||
{
|
||||
this.reportDate = reportDate;
|
||||
}
|
||||
|
||||
public Date getReportDate()
|
||||
{
|
||||
return reportDate;
|
||||
}
|
||||
|
||||
public void setLineType(String lineType)
|
||||
{
|
||||
this.lineType = lineType;
|
||||
}
|
||||
|
||||
public String getLineType()
|
||||
{
|
||||
return lineType;
|
||||
}
|
||||
|
||||
public void setInputWeight(BigDecimal inputWeight)
|
||||
{
|
||||
this.inputWeight = inputWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getInputWeight()
|
||||
{
|
||||
return inputWeight;
|
||||
}
|
||||
|
||||
public void setOutputWeight(BigDecimal outputWeight)
|
||||
{
|
||||
this.outputWeight = outputWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getOutputWeight()
|
||||
{
|
||||
return outputWeight;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setColConfig(String colConfig)
|
||||
{
|
||||
this.colConfig = colConfig;
|
||||
}
|
||||
|
||||
public String getColConfig()
|
||||
{
|
||||
return colConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("reportId", getReportId())
|
||||
.append("reportTitle", getReportTitle())
|
||||
.append("reportDate", getReportDate())
|
||||
.append("lineType", getLineType())
|
||||
.append("inputWeight", getInputWeight())
|
||||
.append("outputWeight", getOutputWeight())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("colConfig", getColConfig())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostItem;
|
||||
|
||||
/**
|
||||
* 成本项目配置Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface CostItemMapper
|
||||
{
|
||||
/**
|
||||
* 查询成本项目配置
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 成本项目配置
|
||||
*/
|
||||
public CostItem selectCostItemByItemId(Long itemId);
|
||||
|
||||
/**
|
||||
* 查询成本项目配置列表
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 成本项目配置集合
|
||||
*/
|
||||
public List<CostItem> selectCostItemList(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 新增成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostItem(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 修改成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostItem(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 删除成本项目配置
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostItemByItemId(Long itemId);
|
||||
|
||||
/**
|
||||
* 批量删除成本项目配置
|
||||
*
|
||||
* @param itemIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostItemByItemIds(Long[] itemIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostPrice;
|
||||
|
||||
/**
|
||||
* 成本单价历史Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface CostPriceMapper
|
||||
{
|
||||
/**
|
||||
* 查询成本单价历史
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 成本单价历史
|
||||
*/
|
||||
public CostPrice selectCostPriceByPriceId(Long priceId);
|
||||
|
||||
/**
|
||||
* 查询成本单价历史列表
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 成本单价历史集合
|
||||
*/
|
||||
public List<CostPrice> selectCostPriceList(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 新增成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostPrice(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 修改成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostPrice(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 删除成本单价历史
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostPriceByPriceId(Long priceId);
|
||||
|
||||
/**
|
||||
* 批量删除成本单价历史
|
||||
*
|
||||
* @param priceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostPriceByPriceIds(Long[] priceIds);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdDetail;
|
||||
|
||||
/**
|
||||
* 生产成本明细Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface CostProdDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产成本明细
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 生产成本明细
|
||||
*/
|
||||
public CostProdDetail selectCostProdDetailByDetailId(Long detailId);
|
||||
|
||||
/**
|
||||
* 查询生产成本明细列表
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 生产成本明细集合
|
||||
*/
|
||||
public List<CostProdDetail> selectCostProdDetailList(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 新增生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdDetail(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 修改生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdDetail(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 删除生产成本明细
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdDetailByDetailId(Long detailId);
|
||||
|
||||
/**
|
||||
* 批量删除生产成本明细
|
||||
*
|
||||
* @param detailIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdDetailByDetailIds(Long[] detailIds);
|
||||
|
||||
/**
|
||||
* 批量新增生产成本明细
|
||||
*
|
||||
* @param list 生产成本明细列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBatch(List<CostProdDetail> list);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdMetric;
|
||||
|
||||
/**
|
||||
* 生产指标明细Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface CostProdMetricMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产指标明细
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 生产指标明细
|
||||
*/
|
||||
public CostProdMetric selectCostProdMetricByMetricId(Long metricId);
|
||||
|
||||
/**
|
||||
* 查询生产指标明细列表
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 生产指标明细集合
|
||||
*/
|
||||
public List<CostProdMetric> selectCostProdMetricList(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 新增生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdMetric(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 修改生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdMetric(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 删除生产指标明细
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdMetricByMetricId(Long metricId);
|
||||
|
||||
/**
|
||||
* 批量删除生产指标明细
|
||||
*
|
||||
* @param metricIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdMetricByMetricIds(Long[] metricIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdReport;
|
||||
|
||||
/**
|
||||
* 生产月报Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface CostProdReportMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产月报
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 生产月报
|
||||
*/
|
||||
public CostProdReport selectCostProdReportByReportId(Long reportId);
|
||||
|
||||
/**
|
||||
* 查询生产月报列表
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 生产月报集合
|
||||
*/
|
||||
public List<CostProdReport> selectCostProdReportList(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 新增生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdReport(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 修改生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdReport(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 删除生产月报
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdReportByReportId(Long reportId);
|
||||
|
||||
/**
|
||||
* 批量删除生产月报
|
||||
*
|
||||
* @param reportIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdReportByReportIds(Long[] reportIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostItem;
|
||||
|
||||
/**
|
||||
* 成本项目配置Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface ICostItemService
|
||||
{
|
||||
/**
|
||||
* 查询成本项目配置
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 成本项目配置
|
||||
*/
|
||||
public CostItem selectCostItemByItemId(Long itemId);
|
||||
|
||||
/**
|
||||
* 查询成本项目配置列表
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 成本项目配置集合
|
||||
*/
|
||||
public List<CostItem> selectCostItemList(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 新增成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostItem(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 修改成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostItem(CostItem costItem);
|
||||
|
||||
/**
|
||||
* 批量删除成本项目配置
|
||||
*
|
||||
* @param itemIds 需要删除的成本项目配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostItemByItemIds(Long[] itemIds);
|
||||
|
||||
/**
|
||||
* 删除成本项目配置信息
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostItemByItemId(Long itemId);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostPrice;
|
||||
|
||||
/**
|
||||
* 成本单价历史Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface ICostPriceService
|
||||
{
|
||||
/**
|
||||
* 查询成本单价历史
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 成本单价历史
|
||||
*/
|
||||
public CostPrice selectCostPriceByPriceId(Long priceId);
|
||||
|
||||
/**
|
||||
* 查询成本单价历史列表
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 成本单价历史集合
|
||||
*/
|
||||
public List<CostPrice> selectCostPriceList(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 新增成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostPrice(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 修改成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostPrice(CostPrice costPrice);
|
||||
|
||||
/**
|
||||
* 批量删除成本单价历史
|
||||
*
|
||||
* @param priceIds 需要删除的成本单价历史主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostPriceByPriceIds(Long[] priceIds);
|
||||
|
||||
/**
|
||||
* 删除成本单价历史信息
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostPriceByPriceId(Long priceId);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.cost.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdDetail;
|
||||
import com.ruoyi.cost.bo.CostProdDetailBo;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 生产成本明细Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface ICostProdDetailService
|
||||
{
|
||||
/**
|
||||
* 查询生产成本明细
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 生产成本明细
|
||||
*/
|
||||
public CostProdDetail selectCostProdDetailByDetailId(Long detailId);
|
||||
|
||||
/**
|
||||
* 查询生产成本明细列表
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 生产成本明细集合
|
||||
*/
|
||||
public List<CostProdDetail> selectCostProdDetailList(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 新增生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdDetail(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 修改生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdDetail(CostProdDetail costProdDetail);
|
||||
|
||||
/**
|
||||
* 批量删除生产成本明细
|
||||
*
|
||||
* @param detailIds 需要删除的生产成本明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdDetailByDetailIds(Long[] detailIds);
|
||||
|
||||
/**
|
||||
* 删除生产成本明细信息
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdDetailByDetailId(Long detailId);
|
||||
|
||||
|
||||
/**
|
||||
* 批量保存生产成本明细(先删除再插入)
|
||||
*
|
||||
* @param bo 批量操作参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchSaveWithDelete(CostProdDetailBo bo);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.cost.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdMetric;
|
||||
|
||||
/**
|
||||
* 生产指标明细Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface ICostProdMetricService
|
||||
{
|
||||
/**
|
||||
* 查询生产指标明细
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 生产指标明细
|
||||
*/
|
||||
public CostProdMetric selectCostProdMetricByMetricId(Long metricId);
|
||||
|
||||
/**
|
||||
* 查询生产指标明细列表
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 生产指标明细集合
|
||||
*/
|
||||
public List<CostProdMetric> selectCostProdMetricList(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 新增生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdMetric(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 修改生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdMetric(CostProdMetric costProdMetric);
|
||||
|
||||
/**
|
||||
* 批量删除生产指标明细
|
||||
*
|
||||
* @param metricIds 需要删除的生产指标明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdMetricByMetricIds(Long[] metricIds);
|
||||
|
||||
/**
|
||||
* 删除生产指标明细信息
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdMetricByMetricId(Long metricId);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.cost.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.cost.domain.CostProdReport;
|
||||
|
||||
/**
|
||||
* 生产月报Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface ICostProdReportService
|
||||
{
|
||||
/**
|
||||
* 查询生产月报
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 生产月报
|
||||
*/
|
||||
public CostProdReport selectCostProdReportByReportId(Long reportId);
|
||||
|
||||
/**
|
||||
* 查询生产月报列表
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 生产月报集合
|
||||
*/
|
||||
public List<CostProdReport> selectCostProdReportList(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 新增生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCostProdReport(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 修改生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCostProdReport(CostProdReport costProdReport);
|
||||
|
||||
/**
|
||||
* 批量删除生产月报
|
||||
*
|
||||
* @param reportIds 需要删除的生产月报主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdReportByReportIds(Long[] reportIds);
|
||||
|
||||
/**
|
||||
* 删除生产月报信息
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCostProdReportByReportId(Long reportId);
|
||||
|
||||
/**
|
||||
* 复制生产月报
|
||||
* 明细列原样保留(itemId不变),指标列重新插入并更新config中的id引用
|
||||
*
|
||||
* @param sourceId 源报表ID
|
||||
* @param bo 新报表覆盖字段
|
||||
* @return 新报表
|
||||
*/
|
||||
public CostProdReport copyReport(Long sourceId, CostProdReport bo);
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.ruoyi.cost.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cost.mapper.CostItemMapper;
|
||||
import com.ruoyi.cost.domain.CostItem;
|
||||
import com.ruoyi.cost.service.ICostItemService;
|
||||
|
||||
/**
|
||||
* 成本项目配置Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class CostItemServiceImpl implements ICostItemService
|
||||
{
|
||||
@Autowired
|
||||
private CostItemMapper costItemMapper;
|
||||
|
||||
/**
|
||||
* 查询成本项目配置
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 成本项目配置
|
||||
*/
|
||||
@Override
|
||||
public CostItem selectCostItemByItemId(Long itemId)
|
||||
{
|
||||
return costItemMapper.selectCostItemByItemId(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成本项目配置列表
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 成本项目配置
|
||||
*/
|
||||
@Override
|
||||
public List<CostItem> selectCostItemList(CostItem costItem)
|
||||
{
|
||||
return costItemMapper.selectCostItemList(costItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCostItem(CostItem costItem)
|
||||
{
|
||||
costItem.setCreateTime(DateUtils.getNowDate());
|
||||
return costItemMapper.insertCostItem(costItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本项目配置
|
||||
*
|
||||
* @param costItem 成本项目配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCostItem(CostItem costItem)
|
||||
{
|
||||
costItem.setUpdateTime(DateUtils.getNowDate());
|
||||
return costItemMapper.updateCostItem(costItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成本项目配置
|
||||
*
|
||||
* @param itemIds 需要删除的成本项目配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostItemByItemIds(Long[] itemIds)
|
||||
{
|
||||
return costItemMapper.deleteCostItemByItemIds(itemIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成本项目配置信息
|
||||
*
|
||||
* @param itemId 成本项目配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostItemByItemId(Long itemId)
|
||||
{
|
||||
return costItemMapper.deleteCostItemByItemId(itemId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.ruoyi.cost.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cost.mapper.CostPriceMapper;
|
||||
import com.ruoyi.cost.domain.CostPrice;
|
||||
import com.ruoyi.cost.service.ICostPriceService;
|
||||
|
||||
/**
|
||||
* 成本单价历史Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class CostPriceServiceImpl implements ICostPriceService
|
||||
{
|
||||
@Autowired
|
||||
private CostPriceMapper costPriceMapper;
|
||||
|
||||
/**
|
||||
* 查询成本单价历史
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 成本单价历史
|
||||
*/
|
||||
@Override
|
||||
public CostPrice selectCostPriceByPriceId(Long priceId)
|
||||
{
|
||||
return costPriceMapper.selectCostPriceByPriceId(priceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成本单价历史列表
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 成本单价历史
|
||||
*/
|
||||
@Override
|
||||
public List<CostPrice> selectCostPriceList(CostPrice costPrice)
|
||||
{
|
||||
return costPriceMapper.selectCostPriceList(costPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCostPrice(CostPrice costPrice)
|
||||
{
|
||||
costPrice.setCreateTime(DateUtils.getNowDate());
|
||||
return costPriceMapper.insertCostPrice(costPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成本单价历史
|
||||
*
|
||||
* @param costPrice 成本单价历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCostPrice(CostPrice costPrice)
|
||||
{
|
||||
costPrice.setUpdateTime(DateUtils.getNowDate());
|
||||
return costPriceMapper.updateCostPrice(costPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成本单价历史
|
||||
*
|
||||
* @param priceIds 需要删除的成本单价历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostPriceByPriceIds(Long[] priceIds)
|
||||
{
|
||||
return costPriceMapper.deleteCostPriceByPriceIds(priceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成本单价历史信息
|
||||
*
|
||||
* @param priceId 成本单价历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostPriceByPriceId(Long priceId)
|
||||
{
|
||||
return costPriceMapper.deleteCostPriceByPriceId(priceId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.ruoyi.cost.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.ruoyi.cost.mapper.CostProdDetailMapper;
|
||||
import com.ruoyi.cost.domain.CostProdDetail;
|
||||
import com.ruoyi.cost.service.ICostProdDetailService;
|
||||
import com.ruoyi.cost.bo.CostProdDetailBo;
|
||||
|
||||
/**
|
||||
* 生产成本明细Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class CostProdDetailServiceImpl implements ICostProdDetailService
|
||||
{
|
||||
@Autowired
|
||||
private CostProdDetailMapper costProdDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询生产成本明细
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 生产成本明细
|
||||
*/
|
||||
@Override
|
||||
public CostProdDetail selectCostProdDetailByDetailId(Long detailId)
|
||||
{
|
||||
return costProdDetailMapper.selectCostProdDetailByDetailId(detailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产成本明细列表
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 生产成本明细
|
||||
*/
|
||||
@Override
|
||||
public List<CostProdDetail> selectCostProdDetailList(CostProdDetail costProdDetail)
|
||||
{
|
||||
return costProdDetailMapper.selectCostProdDetailList(costProdDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCostProdDetail(CostProdDetail costProdDetail)
|
||||
{
|
||||
costProdDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return costProdDetailMapper.insertCostProdDetail(costProdDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产成本明细
|
||||
*
|
||||
* @param costProdDetail 生产成本明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCostProdDetail(CostProdDetail costProdDetail)
|
||||
{
|
||||
costProdDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
return costProdDetailMapper.updateCostProdDetail(costProdDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产成本明细
|
||||
*
|
||||
* @param detailIds 需要删除的生产成本明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdDetailByDetailIds(Long[] detailIds)
|
||||
{
|
||||
return costProdDetailMapper.deleteCostProdDetailByDetailIds(detailIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产成本明细信息
|
||||
*
|
||||
* @param detailId 生产成本明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdDetailByDetailId(Long detailId)
|
||||
{
|
||||
return costProdDetailMapper.deleteCostProdDetailByDetailId(detailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存生产成本明细(先删除再插入)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchSaveWithDelete(CostProdDetailBo bo)
|
||||
{
|
||||
if (!CollectionUtils.isEmpty(bo.getProdDetailList()))
|
||||
{
|
||||
if (!CollectionUtils.isEmpty(bo.getDetailIds()))
|
||||
{
|
||||
// 转成Long[]后删除
|
||||
Long[] ids = bo.getDetailIds().toArray(new Long[0]);
|
||||
costProdDetailMapper.deleteCostProdDetailByDetailIds(ids);
|
||||
}
|
||||
|
||||
// 设置createTime后批量插入
|
||||
List<CostProdDetail> list = bo.getProdDetailList().stream()
|
||||
.peek(item -> item.setCreateTime(DateUtils.getNowDate()))
|
||||
.collect(Collectors.toList());
|
||||
return costProdDetailMapper.insertBatch(list) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.ruoyi.cost.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cost.mapper.CostProdMetricMapper;
|
||||
import com.ruoyi.cost.domain.CostProdMetric;
|
||||
import com.ruoyi.cost.service.ICostProdMetricService;
|
||||
|
||||
/**
|
||||
* 生产指标明细Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class CostProdMetricServiceImpl implements ICostProdMetricService
|
||||
{
|
||||
@Autowired
|
||||
private CostProdMetricMapper costProdMetricMapper;
|
||||
|
||||
/**
|
||||
* 查询生产指标明细
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 生产指标明细
|
||||
*/
|
||||
@Override
|
||||
public CostProdMetric selectCostProdMetricByMetricId(Long metricId)
|
||||
{
|
||||
return costProdMetricMapper.selectCostProdMetricByMetricId(metricId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产指标明细列表
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 生产指标明细
|
||||
*/
|
||||
@Override
|
||||
public List<CostProdMetric> selectCostProdMetricList(CostProdMetric costProdMetric)
|
||||
{
|
||||
return costProdMetricMapper.selectCostProdMetricList(costProdMetric);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCostProdMetric(CostProdMetric costProdMetric)
|
||||
{
|
||||
costProdMetric.setCreateTime(DateUtils.getNowDate());
|
||||
return costProdMetricMapper.insertCostProdMetric(costProdMetric);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产指标明细
|
||||
*
|
||||
* @param costProdMetric 生产指标明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCostProdMetric(CostProdMetric costProdMetric)
|
||||
{
|
||||
costProdMetric.setUpdateTime(DateUtils.getNowDate());
|
||||
return costProdMetricMapper.updateCostProdMetric(costProdMetric);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产指标明细
|
||||
*
|
||||
* @param metricIds 需要删除的生产指标明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdMetricByMetricIds(Long[] metricIds)
|
||||
{
|
||||
return costProdMetricMapper.deleteCostProdMetricByMetricIds(metricIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产指标明细信息
|
||||
*
|
||||
* @param metricId 生产指标明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdMetricByMetricId(Long metricId)
|
||||
{
|
||||
return costProdMetricMapper.deleteCostProdMetricByMetricId(metricId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.ruoyi.cost.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cost.mapper.CostProdMetricMapper;
|
||||
import com.ruoyi.cost.mapper.CostProdReportMapper;
|
||||
import com.ruoyi.cost.domain.CostProdMetric;
|
||||
import com.ruoyi.cost.domain.CostProdReport;
|
||||
import com.ruoyi.cost.service.ICostProdReportService;
|
||||
|
||||
/**
|
||||
* 生产月报Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class CostProdReportServiceImpl implements ICostProdReportService
|
||||
{
|
||||
@Autowired
|
||||
private CostProdReportMapper costProdReportMapper;
|
||||
|
||||
@Autowired
|
||||
private CostProdMetricMapper costProdMetricMapper;
|
||||
|
||||
/**
|
||||
* 查询生产月报
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 生产月报
|
||||
*/
|
||||
@Override
|
||||
public CostProdReport selectCostProdReportByReportId(Long reportId)
|
||||
{
|
||||
return costProdReportMapper.selectCostProdReportByReportId(reportId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产月报列表
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 生产月报
|
||||
*/
|
||||
@Override
|
||||
public List<CostProdReport> selectCostProdReportList(CostProdReport costProdReport)
|
||||
{
|
||||
return costProdReportMapper.selectCostProdReportList(costProdReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCostProdReport(CostProdReport costProdReport)
|
||||
{
|
||||
costProdReport.setCreateTime(DateUtils.getNowDate());
|
||||
return costProdReportMapper.insertCostProdReport(costProdReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产月报
|
||||
*
|
||||
* @param costProdReport 生产月报
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCostProdReport(CostProdReport costProdReport)
|
||||
{
|
||||
costProdReport.setUpdateTime(DateUtils.getNowDate());
|
||||
return costProdReportMapper.updateCostProdReport(costProdReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产月报
|
||||
*
|
||||
* @param reportIds 需要删除的生产月报主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdReportByReportIds(Long[] reportIds)
|
||||
{
|
||||
return costProdReportMapper.deleteCostProdReportByReportIds(reportIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产月报信息
|
||||
*
|
||||
* @param reportId 生产月报主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCostProdReportByReportId(Long reportId)
|
||||
{
|
||||
return costProdReportMapper.deleteCostProdReportByReportId(reportId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制生产月报
|
||||
* 明细列原样保留(itemId不变),指标列重新插入并更新config中的id引用
|
||||
*/
|
||||
@Override
|
||||
public CostProdReport copyReport(Long sourceId, CostProdReport bo)
|
||||
{
|
||||
CostProdReport source = costProdReportMapper.selectCostProdReportByReportId(sourceId);
|
||||
if (source == null)
|
||||
{
|
||||
throw new RuntimeException("源报表不存在");
|
||||
}
|
||||
|
||||
// 创建新报表,先插入以获取ID
|
||||
CostProdReport newRp = new CostProdReport();
|
||||
BeanUtils.copyProperties(source, newRp, "reportId", "colConfig");
|
||||
newRp.setReportTitle(bo.getReportTitle() != null ? bo.getReportTitle() : source.getReportTitle() + "-副本");
|
||||
if (bo.getReportDate() != null) {
|
||||
newRp.setReportDate(bo.getReportDate());
|
||||
}
|
||||
if (bo.getLineType() != null) {
|
||||
newRp.setLineType(bo.getLineType());
|
||||
}
|
||||
if (bo.getInputWeight() != null) {
|
||||
newRp.setInputWeight(bo.getInputWeight());
|
||||
}
|
||||
if (bo.getOutputWeight() != null) {
|
||||
newRp.setOutputWeight(bo.getOutputWeight());
|
||||
}
|
||||
if (bo.getRemark() != null) {
|
||||
newRp.setRemark(bo.getRemark());
|
||||
}
|
||||
newRp.setCreateTime(DateUtils.getNowDate());
|
||||
costProdReportMapper.insertCostProdReport(newRp);
|
||||
Long newRid = newRp.getReportId();
|
||||
|
||||
// 处理colConfig:为每个指标列重新插入metric记录,更新id引用
|
||||
String colConfig = source.getColConfig();
|
||||
if (StringUtils.isNotBlank(colConfig))
|
||||
{
|
||||
JSONObject cfg = JSON.parseObject(colConfig);
|
||||
JSONArray columns = cfg.getJSONArray("columns");
|
||||
if (columns != null && columns.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < columns.size(); i++)
|
||||
{
|
||||
JSONObject col = columns.getJSONObject(i);
|
||||
if ("m".equals(col.getString("t")))
|
||||
{
|
||||
String idStr = col.getString("id");
|
||||
Long oldMetricId = idStr != null ? Long.parseLong(idStr) : null;
|
||||
if (oldMetricId != null)
|
||||
{
|
||||
CostProdMetric srcMetric = costProdMetricMapper.selectCostProdMetricByMetricId(oldMetricId);
|
||||
if (srcMetric != null)
|
||||
{
|
||||
CostProdMetric newMetric = new CostProdMetric();
|
||||
BeanUtils.copyProperties(srcMetric, newMetric, "metricId", "reportId");
|
||||
newMetric.setReportId(newRid);
|
||||
newMetric.setCreateTime(DateUtils.getNowDate());
|
||||
costProdMetricMapper.insertCostProdMetric(newMetric);
|
||||
col.put("id", String.valueOf(newMetric.getMetricId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newRp.setColConfig(cfg.toString());
|
||||
newRp.setUpdateTime(DateUtils.getNowDate());
|
||||
costProdReportMapper.updateCostProdReport(newRp);
|
||||
}
|
||||
}
|
||||
|
||||
return costProdReportMapper.selectCostProdReportByReportId(newRid);
|
||||
}
|
||||
}
|
||||
100
ruoyi-cost/src/main/resources/mapper/cost/CostItemMapper.xml
Normal file
100
ruoyi-cost/src/main/resources/mapper/cost/CostItemMapper.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cost.mapper.CostItemMapper">
|
||||
|
||||
<resultMap type="CostItem" id="CostItemResult">
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="category" column="category" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="queryCondition" column="query_condition" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostItemVo">
|
||||
select item_id, item_code, item_name, category, unit, remark, query_condition, del_flag, create_by, create_time, update_by, update_time from cost_item
|
||||
</sql>
|
||||
|
||||
<select id="selectCostItemList" parameterType="CostItem" resultMap="CostItemResult">
|
||||
<include refid="selectCostItemVo"/>
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="queryCondition != null and queryCondition != ''"> and query_condition = #{queryCondition}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostItemByItemId" parameterType="Long" resultMap="CostItemResult">
|
||||
<include refid="selectCostItemVo"/>
|
||||
where item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostItem" parameterType="CostItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into cost_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="queryCondition != null">query_condition,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="queryCondition != null">#{queryCondition},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostItem" parameterType="CostItem">
|
||||
update cost_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="queryCondition != null">query_condition = #{queryCondition},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostItemByItemId" parameterType="Long">
|
||||
delete from cost_item where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostItemByItemIds" parameterType="String">
|
||||
delete from cost_item where item_id in
|
||||
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cost.mapper.CostPriceMapper">
|
||||
|
||||
<resultMap type="CostPrice" id="CostPriceResult">
|
||||
<result property="priceId" column="price_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostPriceVo">
|
||||
select price_id, item_id, price, effective_date, remark, del_flag, create_by, create_time, update_by, update_time from cost_price
|
||||
</sql>
|
||||
|
||||
<select id="selectCostPriceList" parameterType="CostPrice" resultMap="CostPriceResult">
|
||||
<include refid="selectCostPriceVo"/>
|
||||
<where>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="effectiveDate != null "> and effective_date = #{effectiveDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostPriceByPriceId" parameterType="Long" resultMap="CostPriceResult">
|
||||
<include refid="selectCostPriceVo"/>
|
||||
where price_id = #{priceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostPrice" parameterType="CostPrice" useGeneratedKeys="true" keyProperty="priceId">
|
||||
insert into cost_price
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="effectiveDate != null">effective_date,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="effectiveDate != null">#{effectiveDate},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostPrice" parameterType="CostPrice">
|
||||
update cost_price
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where price_id = #{priceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostPriceByPriceId" parameterType="Long">
|
||||
delete from cost_price where price_id = #{priceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostPriceByPriceIds" parameterType="String">
|
||||
delete from cost_price where price_id in
|
||||
<foreach item="priceId" collection="array" open="(" separator="," close=")">
|
||||
#{priceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cost.mapper.CostProdDetailMapper">
|
||||
|
||||
<resultMap type="CostProdDetail" id="CostProdDetailResult">
|
||||
<result property="detailId" column="detail_id" />
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="shift" column="shift" />
|
||||
<result property="detailDate" column="detail_date" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdDetailVo">
|
||||
select detail_id, report_id, shift, detail_date, item_id, quantity, unit_price, amount, remark, del_flag, create_by, create_time, update_by, update_time from cost_prod_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdDetailList" parameterType="CostProdDetail" resultMap="CostProdDetailResult">
|
||||
<include refid="selectCostProdDetailVo"/>
|
||||
<where>
|
||||
<if test="reportId != null "> and report_id = #{reportId}</if>
|
||||
<if test="shift != null and shift != ''"> and shift = #{shift}</if>
|
||||
<if test="detailDate != null "> and detail_date = #{detailDate}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="amount != null "> and amount = #{amount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdDetailByDetailId" parameterType="Long" resultMap="CostProdDetailResult">
|
||||
<include refid="selectCostProdDetailVo"/>
|
||||
where detail_id = #{detailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdDetail" parameterType="CostProdDetail" useGeneratedKeys="true" keyProperty="detailId">
|
||||
insert into cost_prod_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id,</if>
|
||||
<if test="shift != null">shift,</if>
|
||||
<if test="detailDate != null">detail_date,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">#{reportId},</if>
|
||||
<if test="shift != null">#{shift},</if>
|
||||
<if test="detailDate != null">#{detailDate},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdDetail" parameterType="CostProdDetail">
|
||||
update cost_prod_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id = #{reportId},</if>
|
||||
<if test="shift != null">shift = #{shift},</if>
|
||||
<if test="detailDate != null">detail_date = #{detailDate},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where detail_id = #{detailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdDetailByDetailId" parameterType="Long">
|
||||
delete from cost_prod_detail where detail_id = #{detailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdDetailByDetailIds" parameterType="String">
|
||||
delete from cost_prod_detail where detail_id in
|
||||
<foreach item="detailId" collection="array" open="(" separator="," close=")">
|
||||
#{detailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="detailId">
|
||||
insert into cost_prod_detail (report_id, shift, detail_date, item_id, quantity, unit_price, amount, remark, del_flag, create_by, create_time, update_by, update_time) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.reportId}, #{item.shift}, #{item.detailDate}, #{item.itemId}, #{item.quantity}, #{item.unitPrice}, #{item.amount}, #{item.remark}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cost.mapper.CostProdMetricMapper">
|
||||
|
||||
<resultMap type="CostProdMetric" id="CostProdMetricResult">
|
||||
<result property="metricId" column="metric_id" />
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="metricCode" column="metric_code" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="metricFormula" column="metric_formula" />
|
||||
<result property="metricValue" column="metric_value" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdMetricVo">
|
||||
select metric_id, report_id, metric_code, metric_name, metric_formula, metric_value, remark, del_flag, create_by, create_time, update_by, update_time from cost_prod_metric
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdMetricList" parameterType="CostProdMetric" resultMap="CostProdMetricResult">
|
||||
<include refid="selectCostProdMetricVo"/>
|
||||
<where>
|
||||
<if test="reportId != null "> and report_id = #{reportId}</if>
|
||||
<if test="metricCode != null and metricCode != ''"> and metric_code = #{metricCode}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="metricFormula != null and metricFormula != ''"> and metric_formula = #{metricFormula}</if>
|
||||
<if test="metricValue != null "> and metric_value = #{metricValue}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdMetricByMetricId" parameterType="Long" resultMap="CostProdMetricResult">
|
||||
<include refid="selectCostProdMetricVo"/>
|
||||
where metric_id = #{metricId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdMetric" parameterType="CostProdMetric" useGeneratedKeys="true" keyProperty="metricId">
|
||||
insert into cost_prod_metric
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id,</if>
|
||||
<if test="metricCode != null">metric_code,</if>
|
||||
<if test="metricName != null">metric_name,</if>
|
||||
<if test="metricFormula != null">metric_formula,</if>
|
||||
<if test="metricValue != null">metric_value,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">#{reportId},</if>
|
||||
<if test="metricCode != null">#{metricCode},</if>
|
||||
<if test="metricName != null">#{metricName},</if>
|
||||
<if test="metricFormula != null">#{metricFormula},</if>
|
||||
<if test="metricValue != null">#{metricValue},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdMetric" parameterType="CostProdMetric">
|
||||
update cost_prod_metric
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id = #{reportId},</if>
|
||||
<if test="metricCode != null">metric_code = #{metricCode},</if>
|
||||
<if test="metricName != null">metric_name = #{metricName},</if>
|
||||
<if test="metricFormula != null">metric_formula = #{metricFormula},</if>
|
||||
<if test="metricValue != null">metric_value = #{metricValue},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where metric_id = #{metricId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdMetricByMetricId" parameterType="Long">
|
||||
delete from cost_prod_metric where metric_id = #{metricId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdMetricByMetricIds" parameterType="String">
|
||||
delete from cost_prod_metric where metric_id in
|
||||
<foreach item="metricId" collection="array" open="(" separator="," close=")">
|
||||
#{metricId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cost.mapper.CostProdReportMapper">
|
||||
|
||||
<resultMap type="CostProdReport" id="CostProdReportResult">
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="reportTitle" column="report_title" />
|
||||
<result property="reportDate" column="report_date" />
|
||||
<result property="lineType" column="line_type" />
|
||||
<result property="inputWeight" column="input_weight" />
|
||||
<result property="outputWeight" column="output_weight" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="colConfig" column="col_config" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdReportVo">
|
||||
select report_id, report_title, report_date, line_type, input_weight, output_weight, remark, del_flag, create_by, create_time, update_by, update_time, col_config from cost_prod_report
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdReportList" parameterType="CostProdReport" resultMap="CostProdReportResult">
|
||||
<include refid="selectCostProdReportVo"/>
|
||||
<where>
|
||||
<if test="reportTitle != null and reportTitle != ''"> and report_title = #{reportTitle}</if>
|
||||
<if test="reportDate != null "> and report_date = #{reportDate}</if>
|
||||
<if test="lineType != null and lineType != ''"> and line_type = #{lineType}</if>
|
||||
<if test="inputWeight != null "> and input_weight = #{inputWeight}</if>
|
||||
<if test="outputWeight != null "> and output_weight = #{outputWeight}</if>
|
||||
<if test="colConfig != null and colConfig != ''"> and col_config = #{colConfig}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdReportByReportId" parameterType="Long" resultMap="CostProdReportResult">
|
||||
<include refid="selectCostProdReportVo"/>
|
||||
where report_id = #{reportId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdReport" parameterType="CostProdReport" useGeneratedKeys="true" keyProperty="reportId">
|
||||
insert into cost_prod_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportTitle != null">report_title,</if>
|
||||
<if test="reportDate != null">report_date,</if>
|
||||
<if test="lineType != null">line_type,</if>
|
||||
<if test="inputWeight != null">input_weight,</if>
|
||||
<if test="outputWeight != null">output_weight,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="colConfig != null">col_config,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportTitle != null">#{reportTitle},</if>
|
||||
<if test="reportDate != null">#{reportDate},</if>
|
||||
<if test="lineType != null">#{lineType},</if>
|
||||
<if test="inputWeight != null">#{inputWeight},</if>
|
||||
<if test="outputWeight != null">#{outputWeight},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="colConfig != null">#{colConfig},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdReport" parameterType="CostProdReport">
|
||||
update cost_prod_report
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportTitle != null">report_title = #{reportTitle},</if>
|
||||
<if test="reportDate != null">report_date = #{reportDate},</if>
|
||||
<if test="lineType != null">line_type = #{lineType},</if>
|
||||
<if test="inputWeight != null">input_weight = #{inputWeight},</if>
|
||||
<if test="outputWeight != null">output_weight = #{outputWeight},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="colConfig != null">col_config = #{colConfig},</if>
|
||||
</trim>
|
||||
where report_id = #{reportId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdReportByReportId" parameterType="Long">
|
||||
delete from cost_prod_report where report_id = #{reportId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdReportByReportIds" parameterType="String">
|
||||
delete from cost_prod_report where report_id in
|
||||
<foreach item="reportId" collection="array" open="(" separator="," close=")">
|
||||
#{reportId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -49,6 +49,14 @@ public class DruidConfig
|
||||
return druidProperties.dataSource(dataSource);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.druid.klp")
|
||||
public DataSource klpDataSource(DruidProperties druidProperties)
|
||||
{
|
||||
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
||||
return druidProperties.dataSource(dataSource);
|
||||
}
|
||||
|
||||
@Bean(name = "dynamicDataSource")
|
||||
@Primary
|
||||
public DynamicDataSource dataSource(DataSource masterDataSource)
|
||||
@@ -56,6 +64,7 @@ public class DruidConfig
|
||||
Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
||||
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||
setDataSource(targetDataSources, DataSourceType.KLP.name(), "klpDataSource");
|
||||
return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.ruoyi.framework.jackson.BigNumberSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* jackson 全局配置
|
||||
* <p>
|
||||
* 支持 Long/BigInteger 超出 JS 安全整数范围时自动转为字符串,
|
||||
* 避免前端精度丢失。
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer customizer() {
|
||||
return builder -> {
|
||||
// 全局配置序列化返回 JSON 处理
|
||||
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
||||
// Long 类型:超出 JS 安全范围时序列化为字符串
|
||||
javaTimeModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE);
|
||||
javaTimeModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE);
|
||||
// BigInteger 类型:超出 JS 安全范围时序列化为字符串
|
||||
javaTimeModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE);
|
||||
// BigDecimal 类型:直接序列化为字符串(精度原因)
|
||||
javaTimeModule.addSerializer(BigDecimal.class, com.fasterxml.jackson.databind.ser.std.ToStringSerializer.instance);
|
||||
// LocalDateTime 统一格式化
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter));
|
||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
||||
builder.modules(javaTimeModule);
|
||||
builder.timeZone(TimeZone.getDefault());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.ruoyi.framework.jackson;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
|
||||
import com.fasterxml.jackson.databind.ser.std.NumberSerializer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 超出 JS 最大最小值 处理
|
||||
* 将超出 Number.MAX_SAFE_INTEGER 范围的 Long/BigInteger 序列化为字符串,
|
||||
* 避免前端 JavaScript 精度丢失。
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@JacksonStdImpl
|
||||
public class BigNumberSerializer extends NumberSerializer {
|
||||
|
||||
/**
|
||||
* 根据 JS Number.MAX_SAFE_INTEGER 与 Number.MIN_SAFE_INTEGER 得来
|
||||
*/
|
||||
private static final long MAX_SAFE_INTEGER = 9007199254740991L;
|
||||
private static final long MIN_SAFE_INTEGER = -9007199254740991L;
|
||||
|
||||
/**
|
||||
* 提供实例
|
||||
*/
|
||||
public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class);
|
||||
|
||||
public BigNumberSerializer(Class<? extends Number> rawType) {
|
||||
super(rawType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException {
|
||||
// 在 JS 安全整数范围内 → 正常序列化为 Number
|
||||
if (value.longValue() >= MIN_SAFE_INTEGER && value.longValue() <= MAX_SAFE_INTEGER) {
|
||||
super.serialize(value, gen, provider);
|
||||
} else {
|
||||
// 超出范围 → 序列化为字符串,前端不会丢精度
|
||||
gen.writeString(value.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
|
||||
import com.ruoyi.mill.service.IEqpEquipmentChecklistService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双机架设备检验清单
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/eqp/checklist")
|
||||
public class EqpEquipmentChecklistController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEqpEquipmentChecklistService eqpEquipmentChecklistService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EqpEquipmentChecklist checklist) {
|
||||
startPage();
|
||||
List<EqpEquipmentChecklist> list = eqpEquipmentChecklistService.selectEqpChecklistList(checklist);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:export')")
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EqpEquipmentChecklist checklist) {
|
||||
List<EqpEquipmentChecklist> list = eqpEquipmentChecklistService.selectEqpChecklistList(checklist);
|
||||
ExcelUtil<EqpEquipmentChecklist> util = new ExcelUtil<>(EqpEquipmentChecklist.class);
|
||||
util.exportExcel(response, list, "设备检验清单数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:query')")
|
||||
@GetMapping("/{checkId}")
|
||||
public AjaxResult getInfo(@PathVariable Long checkId) {
|
||||
return success(eqpEquipmentChecklistService.selectEqpChecklistByCheckId(checkId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:add')")
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EqpEquipmentChecklist checklist) {
|
||||
return toAjax(eqpEquipmentChecklistService.insertEqpChecklist(checklist));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:edit')")
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EqpEquipmentChecklist checklist) {
|
||||
return toAjax(eqpEquipmentChecklistService.updateEqpChecklist(checklist));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:remove')")
|
||||
@Log(title = "设备检验清单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{checkIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] checkIds) {
|
||||
return toAjax(eqpEquipmentChecklistService.deleteEqpChecklistByCheckIds(checkIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
|
||||
import com.ruoyi.mill.service.IEqpEquipmentInspectionRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双机架设备巡检记录
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/eqp/record")
|
||||
public class EqpEquipmentInspectionRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEqpEquipmentInspectionRecordService eqpEquipmentInspectionRecordService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EqpEquipmentInspectionRecord record) {
|
||||
startPage();
|
||||
List<EqpEquipmentInspectionRecord> list = eqpEquipmentInspectionRecordService.selectEqpInspectionRecordList(record);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:export')")
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EqpEquipmentInspectionRecord record) {
|
||||
List<EqpEquipmentInspectionRecord> list = eqpEquipmentInspectionRecordService.selectEqpInspectionRecordList(record);
|
||||
ExcelUtil<EqpEquipmentInspectionRecord> util = new ExcelUtil<>(EqpEquipmentInspectionRecord.class);
|
||||
util.exportExcel(response, list, "设备巡检记录数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:query')")
|
||||
@GetMapping("/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable Long recordId) {
|
||||
return success(eqpEquipmentInspectionRecordService.selectEqpInspectionRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:add')")
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EqpEquipmentInspectionRecord record) {
|
||||
return toAjax(eqpEquipmentInspectionRecordService.insertEqpInspectionRecord(record));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:edit')")
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EqpEquipmentInspectionRecord record) {
|
||||
return toAjax(eqpEquipmentInspectionRecordService.updateEqpInspectionRecord(record));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:record:remove')")
|
||||
@Log(title = "设备巡检记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds) {
|
||||
return toAjax(eqpEquipmentInspectionRecordService.deleteEqpInspectionRecordByRecordIds(recordIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.mill.domain.EqpEquipmentPart;
|
||||
import com.ruoyi.mill.service.IEqpEquipmentPartService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双机架设备巡检部位
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/eqp/part")
|
||||
public class EqpEquipmentPartController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEqpEquipmentPartService eqpEquipmentPartService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EqpEquipmentPart part) {
|
||||
startPage();
|
||||
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:export')")
|
||||
@Log(title = "设备巡检部位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EqpEquipmentPart part) {
|
||||
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
|
||||
ExcelUtil<EqpEquipmentPart> util = new ExcelUtil<>(EqpEquipmentPart.class);
|
||||
util.exportExcel(response, list, "设备巡检部位数据");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:query')")
|
||||
@GetMapping("/{partId}")
|
||||
public AjaxResult getInfo(@PathVariable Long partId) {
|
||||
return success(eqpEquipmentPartService.selectEqpPartByPartId(partId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:add')")
|
||||
@Log(title = "设备巡检部位", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EqpEquipmentPart part) {
|
||||
return toAjax(eqpEquipmentPartService.insertEqpPart(part));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:edit')")
|
||||
@Log(title = "设备巡检部位", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EqpEquipmentPart part) {
|
||||
return toAjax(eqpEquipmentPartService.updateEqpPart(part));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:eqp:part:remove')")
|
||||
@Log(title = "设备巡检部位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{partIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] partIds) {
|
||||
return toAjax(eqpEquipmentPartService.deleteEqpPartByPartIds(partIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.mill.domain.KlpCoilInfo;
|
||||
import com.ruoyi.mill.service.IKlpCoilService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mill/klpCoil")
|
||||
public class KlpCoilController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IKlpCoilService klpCoilService;
|
||||
|
||||
@GetMapping("/queryByCoilNo")
|
||||
public AjaxResult queryByCoilNo(@RequestParam String coilNo) {
|
||||
KlpCoilInfo info = klpCoilService.queryByCoilNo(coilNo);
|
||||
if (info == null) {
|
||||
return AjaxResult.error("未找到钢卷信息:" + coilNo);
|
||||
}
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import com.ruoyi.mill.domain.MesRollChangeVo;
|
||||
import com.ruoyi.mill.service.IMesRollChangeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 换辊记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/change")
|
||||
public class MesRollChangeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesRollChangeService mesRollChangeService;
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesRollChange mesRollChange)
|
||||
{
|
||||
startPage();
|
||||
List<MesRollChange> list = mesRollChangeService.selectMesRollChangeList(mesRollChange);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出换辊记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:export')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesRollChange mesRollChange)
|
||||
{
|
||||
List<MesRollChange> list = mesRollChangeService.selectMesRollChangeList(mesRollChange);
|
||||
ExcelUtil<MesRollChange> util = new ExcelUtil<MesRollChange>(MesRollChange.class);
|
||||
util.exportExcel(response, list, "换辊记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取换辊记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:query')")
|
||||
@GetMapping(value = "/{changeId}")
|
||||
public AjaxResult getInfo(@PathVariable("changeId") Long changeId)
|
||||
{
|
||||
return success(mesRollChangeService.selectMesRollChangeByChangeId(changeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:add')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollChange mesRollChange)
|
||||
{
|
||||
return toAjax(mesRollChangeService.insertMesRollChange(mesRollChange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:edit')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollChange mesRollChange)
|
||||
{
|
||||
return toAjax(mesRollChangeService.updateMesRollChange(mesRollChange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:remove')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{changeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] changeIds)
|
||||
{
|
||||
return toAjax(mesRollChangeService.deleteMesRollChangeByChangeIds(changeIds));
|
||||
}
|
||||
|
||||
// ==================== 三级业务端点 ====================
|
||||
|
||||
/**
|
||||
* 查询指定产线+机架当前在机轧辊(最近一次换辊记录)
|
||||
* GET /mill/change/current?lineId=xxx&standNo=1%23
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:query')")
|
||||
@GetMapping("/current")
|
||||
public AjaxResult current(Long lineId, @RequestParam String standNo) {
|
||||
return success(mesRollChangeService.queryCurrentByStand(lineId, standNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定产线各机架各辊位实时工作绩效(工作长度/卷数/重量)
|
||||
* GET /mill/change/performance?lineId=xxx
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:list')")
|
||||
@GetMapping("/performance")
|
||||
public AjaxResult performance(Long lineId) {
|
||||
return success(mesRollChangeService.queryRollPerformance(lineId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MesRollGrind;
|
||||
import com.ruoyi.mill.service.IMesRollGrindService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 磨辊间 /mill/roll/grind
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/roll/grind")
|
||||
public class MesRollGrindController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMesRollGrindService grindService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:grind:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam(required = false) Long rollId,
|
||||
@RequestParam(required = false) String beginTime,
|
||||
@RequestParam(required = false) String endTime) {
|
||||
if (rollId != null) {
|
||||
return AjaxResult.success(grindService.selectMesRollGrindByRollId(rollId));
|
||||
}
|
||||
MesRollGrind query = new MesRollGrind();
|
||||
query.setBeginTime(beginTime);
|
||||
query.setEndTime(endTime);
|
||||
return AjaxResult.success(grindService.selectMesRollGrindList(query));
|
||||
}
|
||||
|
||||
@GetMapping("/monthlyStats")
|
||||
public AjaxResult monthlyStats(@RequestParam Long rollId,
|
||||
@RequestParam(defaultValue = "0") int year) {
|
||||
int y = year > 0 ? year : LocalDate.now().getYear();
|
||||
return AjaxResult.success(grindService.selectMonthlyStats(rollId, y));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:grind:add')")
|
||||
@Log(title = "磨辊间", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollGrind grind) {
|
||||
return toAjax(grindService.insertMesRollGrind(grind));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:grind:edit')")
|
||||
@Log(title = "磨辊间", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollGrind grind) {
|
||||
return toAjax(grindService.updateMesRollGrind(grind));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:grind:remove')")
|
||||
@Log(title = "磨辊间", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{grindId}")
|
||||
public AjaxResult remove(@PathVariable Long grindId) {
|
||||
return toAjax(grindService.deleteMesRollGrindById(grindId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MesRollInfo;
|
||||
import com.ruoyi.mill.service.IMesRollInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 轧辊管理 /mill/roll/info
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/roll/info")
|
||||
public class MesRollInfoController extends BaseController {
|
||||
|
||||
private static final Long DOUBLE_RACK_LINE_ID = 5L;
|
||||
|
||||
@Autowired
|
||||
private IMesRollInfoService rollInfoService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesRollInfo rollInfo) {
|
||||
rollInfo.setLineId(DOUBLE_RACK_LINE_ID);
|
||||
startPage();
|
||||
List<MesRollInfo> list = rollInfoService.selectMesRollInfoList(rollInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/stats")
|
||||
public AjaxResult stats() {
|
||||
return AjaxResult.success(rollInfoService.selectStatusStats(DOUBLE_RACK_LINE_ID));
|
||||
}
|
||||
|
||||
@GetMapping("/options")
|
||||
public AjaxResult options(String rollType, String status) {
|
||||
return AjaxResult.success(rollInfoService.selectRollNoList(DOUBLE_RACK_LINE_ID, rollType, status));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:query')")
|
||||
@GetMapping("/{rollId}")
|
||||
public AjaxResult getInfo(@PathVariable Long rollId) {
|
||||
return AjaxResult.success(rollInfoService.selectMesRollInfoById(rollId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:add')")
|
||||
@Log(title = "轧辊管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollInfo rollInfo) {
|
||||
return toAjax(rollInfoService.insertMesRollInfo(rollInfo));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:edit')")
|
||||
@Log(title = "轧辊管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollInfo rollInfo) {
|
||||
return toAjax(rollInfoService.updateMesRollInfo(rollInfo));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:remove')")
|
||||
@Log(title = "轧辊管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rollIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rollIds) {
|
||||
return toAjax(rollInfoService.deleteMesRollInfoByIds(rollIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:roll:info:edit')")
|
||||
@Log(title = "轧辊管理-封闭", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{rollId}/scrap")
|
||||
public AjaxResult scrap(@PathVariable Long rollId) {
|
||||
rollInfoService.scrapRoll(rollId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MesRollStandby;
|
||||
import com.ruoyi.mill.service.IMesRollStandbyService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/standby")
|
||||
public class MesRollStandbyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesRollStandbyService mesRollStandbyService;
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesRollStandby mesRollStandby)
|
||||
{
|
||||
startPage();
|
||||
List<MesRollStandby> list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出下批轧辊(待换上)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:export')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesRollStandby mesRollStandby)
|
||||
{
|
||||
List<MesRollStandby> list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby);
|
||||
ExcelUtil<MesRollStandby> util = new ExcelUtil<MesRollStandby>(MesRollStandby.class);
|
||||
util.exportExcel(response, list, "下批轧辊(待换上)数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下批轧辊(待换上)详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:query')")
|
||||
@GetMapping(value = "/{standbyId}")
|
||||
public AjaxResult getInfo(@PathVariable("standbyId") Long standbyId)
|
||||
{
|
||||
return success(mesRollStandbyService.selectMesRollStandbyByStandbyId(standbyId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:add')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollStandby mesRollStandby)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.insertMesRollStandby(mesRollStandby));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:edit')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollStandby mesRollStandby)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.updateMesRollStandby(mesRollStandby));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:remove')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{standbyIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] standbyIds)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.deleteMesRollStandbyByStandbyIds(standbyIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空指定产线+机架的全部下批轧辊
|
||||
* DELETE /mill/standby/clear?lineId=xxx&standNo=1%23
|
||||
*/
|
||||
@Log(title = "下批轧辊", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/clear")
|
||||
public AjaxResult clear(Long lineId, @RequestParam String standNo) {
|
||||
return toAjax(mesRollStandbyService.clearByStand(lineId, standNo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MillCoilAbnormal;
|
||||
import com.ruoyi.mill.service.IMillCoilAbnormalService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 钢卷异常信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/abnormal")
|
||||
public class MillCoilAbnormalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMillCoilAbnormalService millCoilAbnormalService;
|
||||
|
||||
/**
|
||||
* 查询钢卷异常信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MillCoilAbnormal millCoilAbnormal)
|
||||
{
|
||||
startPage();
|
||||
List<MillCoilAbnormal> list = millCoilAbnormalService.selectMillCoilAbnormalList(millCoilAbnormal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出钢卷异常信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:export')")
|
||||
@Log(title = "钢卷异常信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MillCoilAbnormal millCoilAbnormal)
|
||||
{
|
||||
List<MillCoilAbnormal> list = millCoilAbnormalService.selectMillCoilAbnormalList(millCoilAbnormal);
|
||||
ExcelUtil<MillCoilAbnormal> util = new ExcelUtil<MillCoilAbnormal>(MillCoilAbnormal.class);
|
||||
util.exportExcel(response, list, "钢卷异常信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取钢卷异常信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:query')")
|
||||
@GetMapping(value = "/{abnormalId}")
|
||||
public AjaxResult getInfo(@PathVariable("abnormalId") Long abnormalId)
|
||||
{
|
||||
return success(millCoilAbnormalService.selectMillCoilAbnormalByAbnormalId(abnormalId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钢卷异常信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:add')")
|
||||
@Log(title = "钢卷异常信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MillCoilAbnormal millCoilAbnormal)
|
||||
{
|
||||
return toAjax(millCoilAbnormalService.insertMillCoilAbnormal(millCoilAbnormal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改钢卷异常信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:edit')")
|
||||
@Log(title = "钢卷异常信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MillCoilAbnormal millCoilAbnormal)
|
||||
{
|
||||
return toAjax(millCoilAbnormalService.updateMillCoilAbnormal(millCoilAbnormal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钢卷异常信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:abnormal:remove')")
|
||||
@Log(title = "钢卷异常信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{abnormalIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] abnormalIds)
|
||||
{
|
||||
return toAjax(millCoilAbnormalService.deleteMillCoilAbnormalByAbnormalIds(abnormalIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.MillCoilAbnormalRelation;
|
||||
import com.ruoyi.mill.service.IMillCoilAbnormalRelationService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 二级-三级钢卷异常挂接/撤回关系Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/relation")
|
||||
public class MillCoilAbnormalRelationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMillCoilAbnormalRelationService millCoilAbnormalRelationService;
|
||||
|
||||
/**
|
||||
* 查询二级-三级钢卷异常挂接/撤回关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MillCoilAbnormalRelation millCoilAbnormalRelation)
|
||||
{
|
||||
startPage();
|
||||
List<MillCoilAbnormalRelation> list = millCoilAbnormalRelationService.selectMillCoilAbnormalRelationList(millCoilAbnormalRelation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出二级-三级钢卷异常挂接/撤回关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:export')")
|
||||
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MillCoilAbnormalRelation millCoilAbnormalRelation)
|
||||
{
|
||||
List<MillCoilAbnormalRelation> list = millCoilAbnormalRelationService.selectMillCoilAbnormalRelationList(millCoilAbnormalRelation);
|
||||
ExcelUtil<MillCoilAbnormalRelation> util = new ExcelUtil<MillCoilAbnormalRelation>(MillCoilAbnormalRelation.class);
|
||||
util.exportExcel(response, list, "二级-三级钢卷异常挂接/撤回关系数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二级-三级钢卷异常挂接/撤回关系详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:query')")
|
||||
@GetMapping(value = "/{relationId}")
|
||||
public AjaxResult getInfo(@PathVariable("relationId") Long relationId)
|
||||
{
|
||||
return success(millCoilAbnormalRelationService.selectMillCoilAbnormalRelationByRelationId(relationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增二级-三级钢卷异常挂接/撤回关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:add')")
|
||||
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MillCoilAbnormalRelation millCoilAbnormalRelation)
|
||||
{
|
||||
return toAjax(millCoilAbnormalRelationService.insertMillCoilAbnormalRelation(millCoilAbnormalRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改二级-三级钢卷异常挂接/撤回关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:edit')")
|
||||
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MillCoilAbnormalRelation millCoilAbnormalRelation)
|
||||
{
|
||||
return toAjax(millCoilAbnormalRelationService.updateMillCoilAbnormalRelation(millCoilAbnormalRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除二级-三级钢卷异常挂接/撤回关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:remove')")
|
||||
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{relationIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] relationIds)
|
||||
{
|
||||
return toAjax(millCoilAbnormalRelationService.deleteMillCoilAbnormalRelationByRelationIds(relationIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂接:将二级异常数据新增到三级异常表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:bind')")
|
||||
@Log(title = "二级异常挂接到三级", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/bind/{secondAbnormalId}")
|
||||
public AjaxResult bind(@PathVariable Long secondAbnormalId)
|
||||
{
|
||||
Long relationId = millCoilAbnormalRelationService.bindToThird(secondAbnormalId, getUsername());
|
||||
return success(relationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回:逻辑删除三级异常表中的挂接数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:relation:withdraw')")
|
||||
@Log(title = "二级异常从三级撤回", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/withdraw/{relationId}")
|
||||
public AjaxResult withdraw(@PathVariable Long relationId, @RequestBody Map<String, String> body)
|
||||
{
|
||||
String operateRemark = body != null ? body.get("operateRemark") : null;
|
||||
return toAjax(millCoilAbnormalRelationService.withdrawFromThird(relationId, getUsername(), operateRemark));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.mill.protocol.MillDataCodec;
|
||||
import com.ruoyi.mill.protocol.MillDataField;
|
||||
import com.ruoyi.mill.protocol.MillDataSchema;
|
||||
import com.ruoyi.mill.udp.MillDataRecord;
|
||||
import com.ruoyi.mill.udp.MillDataStore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 新协议报文调试控制器
|
||||
* 帧格式:[4字节LE ID][4字节LE 数据体长度][数据体]
|
||||
*/
|
||||
@Api(tags = "轧线 - 新协议报文调试")
|
||||
@RestController
|
||||
@RequestMapping("/mill/data")
|
||||
public class MillDataController extends BaseController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MillDataController.class);
|
||||
|
||||
@Autowired
|
||||
private MillDataStore millDataStore;
|
||||
|
||||
// ── Schema 查询 ────────────────────────────────────────────────────
|
||||
|
||||
@ApiOperation("获取所有报文Schema定义")
|
||||
@GetMapping("/schemas")
|
||||
public AjaxResult getSchemas() {
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
Map<Integer, String> descs = MillDataSchema.getIdDescriptions();
|
||||
|
||||
List<Map<String, Object>> schemaList = new ArrayList<>();
|
||||
for (Map.Entry<Integer, List<MillDataField>> entry : MillDataSchema.getAllSchemas().entrySet()) {
|
||||
int id = entry.getKey();
|
||||
List<MillDataField> schema = entry.getValue();
|
||||
|
||||
Map<String, Object> item = new LinkedHashMap<>();
|
||||
item.put("id", id);
|
||||
item.put("description", descs.getOrDefault(id, ""));
|
||||
item.put("totalBytes", schema.stream().mapToInt(MillDataField::byteLength).sum());
|
||||
|
||||
List<Map<String, Object>> fields = new ArrayList<>();
|
||||
for (MillDataField f : schema) {
|
||||
Map<String, Object> fd = new LinkedHashMap<>();
|
||||
fd.put("name", f.getName());
|
||||
fd.put("description", f.getDescription());
|
||||
fd.put("unit", f.getUnit());
|
||||
fd.put("type", f.getType().name());
|
||||
fd.put("byteLength", f.byteLength());
|
||||
if (f.hasBits()) {
|
||||
List<Map<String, Object>> bits = new ArrayList<>();
|
||||
for (Map.Entry<Integer, String> be : f.getBitNames().entrySet()) {
|
||||
Map<String, Object> bit = new LinkedHashMap<>();
|
||||
bit.put("index", be.getKey());
|
||||
bit.put("name", be.getValue());
|
||||
bit.put("description", f.getBitDescriptions().getOrDefault(be.getKey(), ""));
|
||||
bits.add(bit);
|
||||
}
|
||||
fd.put("bits", bits);
|
||||
}
|
||||
fields.add(fd);
|
||||
}
|
||||
item.put("fields", fields);
|
||||
schemaList.add(item);
|
||||
}
|
||||
result.put("schemas", schemaList);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
// ── 发送 ──────────────────────────────────────────────────────────
|
||||
|
||||
@ApiOperation("发送新协议报文到指定IP:Port")
|
||||
@PostMapping("/send")
|
||||
public AjaxResult send(@RequestBody Map<String, Object> req) {
|
||||
try {
|
||||
// 目标地址
|
||||
String host = (String) req.get("host");
|
||||
Object portObj = req.get("port");
|
||||
if (host == null || host.isEmpty()) return error("host不能为空");
|
||||
if (portObj == null) return error("port不能为空");
|
||||
int port = ((Number) portObj).intValue();
|
||||
|
||||
// 报文ID
|
||||
Object idObj = req.get("id");
|
||||
if (idObj == null) return error("id不能为空");
|
||||
int id = ((Number) idObj).intValue();
|
||||
|
||||
List<MillDataField> schema = MillDataSchema.getSchema(id);
|
||||
if (schema == null) return error("未知报文ID: " + id);
|
||||
|
||||
// 字段值
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> values = req.containsKey("fields")
|
||||
? (Map<String, Object>) req.get("fields")
|
||||
: Collections.emptyMap();
|
||||
|
||||
byte[] frame = MillDataCodec.encodePacket(id, schema, values);
|
||||
|
||||
// UDP发送
|
||||
boolean ok = udpSend(host, port, frame);
|
||||
|
||||
// 解码已发送的数据体用于记录
|
||||
byte[] body = Arrays.copyOfRange(frame, 8, frame.length);
|
||||
Map<String, Object> decoded = MillDataCodec.decodeBody(schema, body);
|
||||
millDataStore.addOutbound(id, frame, decoded, ok, host, port);
|
||||
|
||||
if (ok) {
|
||||
log.info("[MILL-DATA] 发送成功 id={} -> {}:{} frameLen={}", id, host, port, frame.length);
|
||||
Map<String, Object> resp = new LinkedHashMap<>();
|
||||
resp.put("frameLength", frame.length);
|
||||
resp.put("dataLength", frame.length - 8);
|
||||
resp.put("hexPreview", MillDataCodec.toHexString(Arrays.copyOf(frame, Math.min(frame.length, 32))));
|
||||
return success(resp);
|
||||
} else {
|
||||
return error("UDP发送失败");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[MILL-DATA] 发送异常", e);
|
||||
return error("发送异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("发送原始Hex报文到指定IP:Port")
|
||||
@PostMapping("/sendRaw")
|
||||
public AjaxResult sendRaw(@RequestBody Map<String, Object> req) {
|
||||
try {
|
||||
String host = (String) req.get("host");
|
||||
Object portObj = req.get("port");
|
||||
String hexStr = (String) req.get("hex");
|
||||
if (host == null || host.isEmpty()) return error("host不能为空");
|
||||
if (portObj == null) return error("port不能为空");
|
||||
if (hexStr == null || hexStr.isEmpty()) return error("hex不能为空");
|
||||
|
||||
int port = ((Number) portObj).intValue();
|
||||
hexStr = hexStr.replaceAll("[\\s\\-]", "");
|
||||
if (hexStr.length() % 2 != 0) return error("hex字符串长度必须为偶数");
|
||||
|
||||
byte[] frame = new byte[hexStr.length() / 2];
|
||||
for (int i = 0; i < frame.length; i++) {
|
||||
frame[i] = (byte) Integer.parseInt(hexStr.substring(i * 2, i * 2 + 2), 16);
|
||||
}
|
||||
|
||||
int packetId = MillDataCodec.peekId(frame);
|
||||
List<MillDataField> schema = MillDataSchema.getSchema(packetId);
|
||||
|
||||
boolean ok = udpSend(host, port, frame);
|
||||
|
||||
Map<String, Object> decoded = null;
|
||||
if (schema != null && frame.length >= 8) {
|
||||
byte[] body = Arrays.copyOfRange(frame, 8, frame.length);
|
||||
decoded = MillDataCodec.decodeBody(schema, body);
|
||||
}
|
||||
millDataStore.addOutbound(packetId, frame, decoded, ok, host, port);
|
||||
|
||||
if (ok) {
|
||||
Map<String, Object> r = new LinkedHashMap<>();
|
||||
r.put("frameLength", frame.length);
|
||||
return success(r);
|
||||
} else {
|
||||
return error("UDP发送失败");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[MILL-DATA] 原始发送异常", e);
|
||||
return error("发送异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// ── 解析 ──────────────────────────────────────────────────────────
|
||||
|
||||
@ApiOperation("解析Hex字节为字段值")
|
||||
@PostMapping("/parse")
|
||||
public AjaxResult parse(@RequestBody Map<String, Object> req) {
|
||||
try {
|
||||
String hexStr = (String) req.get("hex");
|
||||
if (hexStr == null || hexStr.isEmpty()) return error("hex不能为空");
|
||||
|
||||
hexStr = hexStr.replaceAll("[\\s\\-]", "");
|
||||
byte[] data = new byte[hexStr.length() / 2];
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
data[i] = (byte) Integer.parseInt(hexStr.substring(i * 2, i * 2 + 2), 16);
|
||||
}
|
||||
|
||||
Map<String, Object> result = MillDataCodec.decodePacket(data, MillDataSchema.getAllSchemas());
|
||||
|
||||
// 将rawBody转为hex展示
|
||||
byte[] rawBody = (byte[]) result.get("rawBody");
|
||||
if (rawBody != null) {
|
||||
result.put("rawBodyHex", MillDataCodec.toHexString(rawBody));
|
||||
result.remove("rawBody");
|
||||
}
|
||||
return success(result);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[MILL-DATA] 解析异常", e);
|
||||
return error("解析异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// ── 历史记录 ──────────────────────────────────────────────────────
|
||||
|
||||
@ApiOperation("获取报文历史记录")
|
||||
@GetMapping("/history")
|
||||
public AjaxResult history(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "50") Integer pageSize) {
|
||||
List<MillDataRecord> rows = millDataStore.getHistory(pageNum, pageSize);
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("rows", rows);
|
||||
result.put("total", millDataStore.getTotalCount());
|
||||
return success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("获取统计信息")
|
||||
@GetMapping("/stats")
|
||||
public AjaxResult stats() {
|
||||
Map<String, Object> stats = new LinkedHashMap<>();
|
||||
int total = millDataStore.getTotalCount();
|
||||
long success = millDataStore.countSuccess();
|
||||
stats.put("total", total);
|
||||
stats.put("inbound", millDataStore.countInbound());
|
||||
stats.put("outbound", millDataStore.countOutbound());
|
||||
stats.put("successRate", total > 0 ? Math.round(success * 100.0 / total) : 100);
|
||||
return success(stats);
|
||||
}
|
||||
|
||||
@ApiOperation("清空历史记录")
|
||||
@DeleteMapping("/history")
|
||||
public AjaxResult clearHistory() {
|
||||
millDataStore.clear();
|
||||
return success();
|
||||
}
|
||||
|
||||
// ── 内部工具 ──────────────────────────────────────────────────────
|
||||
|
||||
private boolean udpSend(String host, int port, byte[] data) {
|
||||
try (DatagramSocket socket = new DatagramSocket()) {
|
||||
socket.setSoTimeout(3000);
|
||||
InetAddress addr = InetAddress.getByName(host);
|
||||
DatagramPacket pkt = new DatagramPacket(data, data.length, addr, port);
|
||||
socket.send(pkt);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.warn("[MILL-DATA] UDP发送失败 {}:{} : {}", host, port, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.QcInspectionItem;
|
||||
import com.ruoyi.mill.service.IQcInspectionItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mill/qc/item")
|
||||
public class QcInspectionItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IQcInspectionItemService itemService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcInspectionItem item) {
|
||||
startPage();
|
||||
List<QcInspectionItem> list = itemService.selectQcInspectionItemList(item);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/byTask/{taskId}")
|
||||
public AjaxResult listByTask(@PathVariable Long taskId) {
|
||||
return AjaxResult.success(itemService.selectQcInspectionItemByTaskId(taskId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:query')")
|
||||
@GetMapping("/{itemId}")
|
||||
public AjaxResult getInfo(@PathVariable Long itemId) {
|
||||
return AjaxResult.success(itemService.selectQcInspectionItemById(itemId));
|
||||
}
|
||||
|
||||
@Log(title = "检验项目", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcInspectionItem item) {
|
||||
return toAjax(itemService.updateQcInspectionItem(item));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.QcInspectionTask;
|
||||
import com.ruoyi.mill.service.IQcInspectionTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mill/qc/task")
|
||||
public class QcInspectionTaskController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IQcInspectionTaskService taskService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcInspectionTask task) {
|
||||
startPage();
|
||||
List<QcInspectionTask> list = taskService.selectQcInspectionTaskListByDoubleRack(task);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:query')")
|
||||
@GetMapping("/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable Long taskId) {
|
||||
return AjaxResult.success(taskService.selectQcInspectionTaskById(taskId));
|
||||
}
|
||||
|
||||
@Log(title = "检验任务", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcInspectionTask task) {
|
||||
return toAjax(taskService.insertQcInspectionTask(task));
|
||||
}
|
||||
|
||||
@Log(title = "检验任务", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcInspectionTask task) {
|
||||
return toAjax(taskService.updateQcInspectionTask(task));
|
||||
}
|
||||
|
||||
@Log(title = "检验任务", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:task:remove')")
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
||||
return toAjax(taskService.deleteQcInspectionTaskByIds(taskIds));
|
||||
}
|
||||
|
||||
@GetMapping("/coils")
|
||||
public AjaxResult coilList() {
|
||||
return AjaxResult.success(taskService.selectDoubleRackCoilList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.mill.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mill.domain.WmsCoilAbnormal;
|
||||
import com.ruoyi.mill.service.IWmsCoilAbnormalService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mill/qc/abnormal")
|
||||
public class WmsCoilAbnormalController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWmsCoilAbnormalService abnormalService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsCoilAbnormal abnormal) {
|
||||
startPage();
|
||||
List<WmsCoilAbnormal> list = abnormalService.selectWmsCoilAbnormalListByDoubleRack(abnormal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:query')")
|
||||
@GetMapping("/{abnormalId}")
|
||||
public AjaxResult getInfo(@PathVariable Long abnormalId) {
|
||||
return AjaxResult.success(abnormalService.selectWmsCoilAbnormalById(abnormalId));
|
||||
}
|
||||
|
||||
@Log(title = "质量异常", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmsCoilAbnormal abnormal) {
|
||||
return toAjax(abnormalService.insertWmsCoilAbnormal(abnormal));
|
||||
}
|
||||
|
||||
@Log(title = "质量异常", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmsCoilAbnormal abnormal) {
|
||||
return toAjax(abnormalService.updateWmsCoilAbnormal(abnormal));
|
||||
}
|
||||
|
||||
@Log(title = "质量异常", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:remove')")
|
||||
@DeleteMapping("/{abnormalIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] abnormalIds) {
|
||||
return toAjax(abnormalService.deleteWmsCoilAbnormalByIds(abnormalIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 双机架设备检验清单 mill_eqp_checklist
|
||||
*/
|
||||
@Data
|
||||
public class EqpEquipmentChecklist extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "清单ID")
|
||||
private Long checkId;
|
||||
|
||||
@Excel(name = "检验编号")
|
||||
private String checkNo;
|
||||
|
||||
@Excel(name = "巡检部位ID")
|
||||
private Long partId;
|
||||
|
||||
@Excel(name = "设备部件名称")
|
||||
private String partName;
|
||||
|
||||
@Excel(name = "检验内容")
|
||||
private String checkContent;
|
||||
|
||||
@Excel(name = "设备状态")
|
||||
private String equipmentState;
|
||||
|
||||
@Excel(name = "检验标准")
|
||||
private String checkStandard;
|
||||
|
||||
@Excel(name = "责任人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "产线")
|
||||
private String productionLine;
|
||||
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 双机架设备巡检记录 mill_eqp_inspection_record
|
||||
*/
|
||||
@Data
|
||||
public class EqpEquipmentInspectionRecord extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "记录ID")
|
||||
private Long recordId;
|
||||
|
||||
@Excel(name = "检验清单ID")
|
||||
private Long checkId;
|
||||
|
||||
/** 班次 1白班 2夜班 */
|
||||
@Excel(name = "班次")
|
||||
private Integer shift;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
|
||||
/** 运行状态 1正常 2故障 */
|
||||
@Excel(name = "运行状态")
|
||||
private Integer runStatus;
|
||||
|
||||
@Excel(name = "巡检人")
|
||||
private String inspector;
|
||||
|
||||
@Excel(name = "异常描述")
|
||||
private String abnormalDesc;
|
||||
|
||||
@Excel(name = "巡检照片")
|
||||
private String photo;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
// 关联字段(查询时带出)
|
||||
private Long partId;
|
||||
private String checkContent;
|
||||
private String checkStandard;
|
||||
private String partName;
|
||||
private String productionLine;
|
||||
|
||||
// 时间范围查询参数
|
||||
private String startInspectTime;
|
||||
private String endInspectTime;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 双机架设备巡检部位 mill_eqp_part
|
||||
*/
|
||||
@Data
|
||||
public class EqpEquipmentPart extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "部位ID")
|
||||
private Long partId;
|
||||
|
||||
@Excel(name = "巡检部位")
|
||||
private String inspectPart;
|
||||
|
||||
@Excel(name = "产线")
|
||||
private String productionLine;
|
||||
|
||||
@Excel(name = "产线段")
|
||||
private String lineSection;
|
||||
|
||||
@Excel(name = "负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/** 三级 WMS 钢卷信息(只读,从 klp-oa-test.wms_material_coil 查询) */
|
||||
@Data
|
||||
public class KlpCoilInfo {
|
||||
private Long coilId;
|
||||
private String enterCoilNo;
|
||||
private String currentCoilNo;
|
||||
private String supplierCoilNo;
|
||||
private String actualThickness;
|
||||
private BigDecimal actualWidth;
|
||||
private BigDecimal netWeight;
|
||||
private BigDecimal grossWeight;
|
||||
private BigDecimal length;
|
||||
private String qualityStatus;
|
||||
private String materialType;
|
||||
private String temperGrade;
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 换辊记录对象 mes_roll_change
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class MesRollChange extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long changeId;
|
||||
|
||||
/** 产线ID(关联 wms_production_line.line_id) */
|
||||
@Excel(name = "产线ID", readConverterExp = "关=联,w=ms_production_line.line_id")
|
||||
private Long lineId;
|
||||
|
||||
/** 换辊编号 */
|
||||
@Excel(name = "换辊编号")
|
||||
private String changeNo;
|
||||
|
||||
/** 换辊时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "换辊时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date changeTime;
|
||||
|
||||
/** 机架号: 1# / 2# */
|
||||
@Excel(name = "机架号: 1# / 2#")
|
||||
private String standNo;
|
||||
|
||||
/** 换辊类型: 计划换辊/紧急换辊 */
|
||||
@Excel(name = "换辊类型: 计划换辊/紧急换辊")
|
||||
private String changeType;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String changeStatus;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String operator;
|
||||
|
||||
/** 上工作辊编号 */
|
||||
@Excel(name = "上工作辊编号")
|
||||
private String upperWrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal upperWrDia;
|
||||
|
||||
/** 下工作辊编号 */
|
||||
@Excel(name = "下工作辊编号")
|
||||
private String lowerWrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal lowerWrDia;
|
||||
|
||||
/** 上支撑辊编号 */
|
||||
@Excel(name = "上支撑辊编号")
|
||||
private String upperBrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal upperBrDia;
|
||||
|
||||
/** 下支撑辊编号 */
|
||||
@Excel(name = "下支撑辊编号")
|
||||
private String lowerBrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal lowerBrDia;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long delFlag;
|
||||
|
||||
public void setChangeId(Long changeId)
|
||||
{
|
||||
this.changeId = changeId;
|
||||
}
|
||||
|
||||
public Long getChangeId()
|
||||
{
|
||||
return changeId;
|
||||
}
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setChangeNo(String changeNo)
|
||||
{
|
||||
this.changeNo = changeNo;
|
||||
}
|
||||
|
||||
public String getChangeNo()
|
||||
{
|
||||
return changeNo;
|
||||
}
|
||||
|
||||
public void setChangeTime(Date changeTime)
|
||||
{
|
||||
this.changeTime = changeTime;
|
||||
}
|
||||
|
||||
public Date getChangeTime()
|
||||
{
|
||||
return changeTime;
|
||||
}
|
||||
|
||||
public void setStandNo(String standNo)
|
||||
{
|
||||
this.standNo = standNo;
|
||||
}
|
||||
|
||||
public String getStandNo()
|
||||
{
|
||||
return standNo;
|
||||
}
|
||||
|
||||
public void setChangeType(String changeType)
|
||||
{
|
||||
this.changeType = changeType;
|
||||
}
|
||||
|
||||
public String getChangeType()
|
||||
{
|
||||
return changeType;
|
||||
}
|
||||
|
||||
public void setChangeStatus(String changeStatus)
|
||||
{
|
||||
this.changeStatus = changeStatus;
|
||||
}
|
||||
|
||||
public String getChangeStatus()
|
||||
{
|
||||
return changeStatus;
|
||||
}
|
||||
|
||||
public void setOperator(String operator)
|
||||
{
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperator()
|
||||
{
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setUpperWrNo(String upperWrNo)
|
||||
{
|
||||
this.upperWrNo = upperWrNo;
|
||||
}
|
||||
|
||||
public String getUpperWrNo()
|
||||
{
|
||||
return upperWrNo;
|
||||
}
|
||||
|
||||
public void setUpperWrDia(BigDecimal upperWrDia)
|
||||
{
|
||||
this.upperWrDia = upperWrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getUpperWrDia()
|
||||
{
|
||||
return upperWrDia;
|
||||
}
|
||||
|
||||
public void setLowerWrNo(String lowerWrNo)
|
||||
{
|
||||
this.lowerWrNo = lowerWrNo;
|
||||
}
|
||||
|
||||
public String getLowerWrNo()
|
||||
{
|
||||
return lowerWrNo;
|
||||
}
|
||||
|
||||
public void setLowerWrDia(BigDecimal lowerWrDia)
|
||||
{
|
||||
this.lowerWrDia = lowerWrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getLowerWrDia()
|
||||
{
|
||||
return lowerWrDia;
|
||||
}
|
||||
|
||||
public void setUpperBrNo(String upperBrNo)
|
||||
{
|
||||
this.upperBrNo = upperBrNo;
|
||||
}
|
||||
|
||||
public String getUpperBrNo()
|
||||
{
|
||||
return upperBrNo;
|
||||
}
|
||||
|
||||
public void setUpperBrDia(BigDecimal upperBrDia)
|
||||
{
|
||||
this.upperBrDia = upperBrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getUpperBrDia()
|
||||
{
|
||||
return upperBrDia;
|
||||
}
|
||||
|
||||
public void setLowerBrNo(String lowerBrNo)
|
||||
{
|
||||
this.lowerBrNo = lowerBrNo;
|
||||
}
|
||||
|
||||
public String getLowerBrNo()
|
||||
{
|
||||
return lowerBrNo;
|
||||
}
|
||||
|
||||
public void setLowerBrDia(BigDecimal lowerBrDia)
|
||||
{
|
||||
this.lowerBrDia = lowerBrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getLowerBrDia()
|
||||
{
|
||||
return lowerBrDia;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("changeId", getChangeId())
|
||||
.append("lineId", getLineId())
|
||||
.append("changeNo", getChangeNo())
|
||||
.append("changeTime", getChangeTime())
|
||||
.append("standNo", getStandNo())
|
||||
.append("changeType", getChangeType())
|
||||
.append("changeStatus", getChangeStatus())
|
||||
.append("operator", getOperator())
|
||||
.append("upperWrNo", getUpperWrNo())
|
||||
.append("upperWrDia", getUpperWrDia())
|
||||
.append("lowerWrNo", getLowerWrNo())
|
||||
.append("lowerWrDia", getLowerWrDia())
|
||||
.append("upperBrNo", getUpperBrNo())
|
||||
.append("upperBrDia", getUpperBrDia())
|
||||
.append("lowerBrNo", getLowerBrNo())
|
||||
.append("lowerBrDia", getLowerBrDia())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 换辊记录 VO — 用于前端展示在机轧辊信息及绩效统计
|
||||
*/
|
||||
public class MesRollChangeVo {
|
||||
|
||||
private Long lineId;
|
||||
private String standNo;
|
||||
|
||||
// 上工作辊
|
||||
private String upperWrNo;
|
||||
private BigDecimal upperWrDia;
|
||||
|
||||
// 下工作辊
|
||||
private String lowerWrNo;
|
||||
private BigDecimal lowerWrDia;
|
||||
|
||||
// 上支撑辊
|
||||
private String upperBrNo;
|
||||
private BigDecimal upperBrDia;
|
||||
|
||||
// 下支撑辊
|
||||
private String lowerBrNo;
|
||||
private BigDecimal lowerBrDia;
|
||||
|
||||
// 换辊时间
|
||||
private Date changeTime;
|
||||
|
||||
// 绩效统计
|
||||
private BigDecimal workLength;
|
||||
private Integer coilCount;
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
public Long getLineId() { return lineId; }
|
||||
public void setLineId(Long lineId) { this.lineId = lineId; }
|
||||
|
||||
public String getStandNo() { return standNo; }
|
||||
public void setStandNo(String standNo) { this.standNo = standNo; }
|
||||
|
||||
public String getUpperWrNo() { return upperWrNo; }
|
||||
public void setUpperWrNo(String upperWrNo) { this.upperWrNo = upperWrNo; }
|
||||
|
||||
public BigDecimal getUpperWrDia() { return upperWrDia; }
|
||||
public void setUpperWrDia(BigDecimal upperWrDia) { this.upperWrDia = upperWrDia; }
|
||||
|
||||
public String getLowerWrNo() { return lowerWrNo; }
|
||||
public void setLowerWrNo(String lowerWrNo) { this.lowerWrNo = lowerWrNo; }
|
||||
|
||||
public BigDecimal getLowerWrDia() { return lowerWrDia; }
|
||||
public void setLowerWrDia(BigDecimal lowerWrDia) { this.lowerWrDia = lowerWrDia; }
|
||||
|
||||
public String getUpperBrNo() { return upperBrNo; }
|
||||
public void setUpperBrNo(String upperBrNo) { this.upperBrNo = upperBrNo; }
|
||||
|
||||
public BigDecimal getUpperBrDia() { return upperBrDia; }
|
||||
public void setUpperBrDia(BigDecimal upperBrDia) { this.upperBrDia = upperBrDia; }
|
||||
|
||||
public String getLowerBrNo() { return lowerBrNo; }
|
||||
public void setLowerBrNo(String lowerBrNo) { this.lowerBrNo = lowerBrNo; }
|
||||
|
||||
public BigDecimal getLowerBrDia() { return lowerBrDia; }
|
||||
public void setLowerBrDia(BigDecimal lowerBrDia) { this.lowerBrDia = lowerBrDia; }
|
||||
|
||||
public Date getChangeTime() { return changeTime; }
|
||||
public void setChangeTime(Date changeTime) { this.changeTime = changeTime; }
|
||||
|
||||
public BigDecimal getWorkLength() { return workLength; }
|
||||
public void setWorkLength(BigDecimal workLength) { this.workLength = workLength; }
|
||||
|
||||
public Integer getCoilCount() { return coilCount; }
|
||||
public void setCoilCount(Integer coilCount) { this.coilCount = coilCount; }
|
||||
|
||||
public BigDecimal getTotalWeight() { return totalWeight; }
|
||||
public void setTotalWeight(BigDecimal totalWeight) { this.totalWeight = totalWeight; }
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 磨辊记录 mes_roll_grind
|
||||
*/
|
||||
@Data
|
||||
public class MesRollGrind extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "磨削记录ID")
|
||||
private Long grindId;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
@Excel(name = "轧辊ID")
|
||||
private Long rollId;
|
||||
|
||||
@Excel(name = "轧辊编号")
|
||||
private String rollNo;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "磨削时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date grindTime;
|
||||
|
||||
@Excel(name = "班组")
|
||||
private String team;
|
||||
|
||||
@Excel(name = "磨前直径(mm)")
|
||||
private BigDecimal diaBefore;
|
||||
|
||||
@Excel(name = "磨后直径(mm)")
|
||||
private BigDecimal diaAfter;
|
||||
|
||||
@Excel(name = "磨削量(mm)")
|
||||
private BigDecimal grindAmount;
|
||||
|
||||
@Excel(name = "辊型")
|
||||
private String rollShape;
|
||||
|
||||
@Excel(name = "探伤结果")
|
||||
private String flawResult;
|
||||
|
||||
@Excel(name = "硬度")
|
||||
private BigDecimal hardness;
|
||||
|
||||
@Excel(name = "操作者")
|
||||
private String operator;
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
// 时间范围查询
|
||||
private String beginTime;
|
||||
private String endTime;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 轧辊库 mes_roll_info
|
||||
*/
|
||||
@Data
|
||||
public class MesRollInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "轧辊ID")
|
||||
private Long rollId;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
@Excel(name = "轧辊编号")
|
||||
private String rollNo;
|
||||
|
||||
/** WR=工作辊 / BR=支撑辊 */
|
||||
@Excel(name = "辊型")
|
||||
private String rollType;
|
||||
|
||||
/** Offline / Standby / Online / Scrapped */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "初始辊径(mm)")
|
||||
private BigDecimal initialDia;
|
||||
|
||||
@Excel(name = "当前辊径(mm)")
|
||||
private BigDecimal currentDia;
|
||||
|
||||
@Excel(name = "最小辊径(mm)")
|
||||
private BigDecimal minDia;
|
||||
|
||||
@Excel(name = "粗糙度")
|
||||
private BigDecimal roughness;
|
||||
|
||||
@Excel(name = "凸度")
|
||||
private BigDecimal crown;
|
||||
|
||||
@Excel(name = "材质")
|
||||
private String material;
|
||||
|
||||
@Excel(name = "磨削次数")
|
||||
private Integer grindCount;
|
||||
|
||||
@Excel(name = "累计轧制重量(t)")
|
||||
private BigDecimal totalRolledWeight;
|
||||
|
||||
@Excel(name = "累计轧制长度(m)")
|
||||
private BigDecimal totalRolledLength;
|
||||
|
||||
@Excel(name = "累计轧制卷数")
|
||||
private Integer totalRolledCount;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "制造日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date manufactureDate;
|
||||
|
||||
@Excel(name = "厂家")
|
||||
private String manufacturer;
|
||||
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)对象 mes_roll_standby
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class MesRollStandby extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long standbyId;
|
||||
|
||||
/** 产线ID(关联 wms_production_line.line_id) */
|
||||
@Excel(name = "产线ID", readConverterExp = "关=联,w=ms_production_line.line_id")
|
||||
private Long lineId;
|
||||
|
||||
/** 机架号: 1# / 2# */
|
||||
@Excel(name = "机架号: 1# / 2#")
|
||||
private String standNo;
|
||||
|
||||
/** 轧辊编号 */
|
||||
@Excel(name = "轧辊编号")
|
||||
private String rollNo;
|
||||
|
||||
/** WR=工作辊 / BR=支撑辊 */
|
||||
@Excel(name = "WR=工作辊 / BR=支撑辊")
|
||||
private String rollType;
|
||||
|
||||
/** UP=上 / DOWN=下 */
|
||||
@Excel(name = "UP=上 / DOWN=下")
|
||||
private String position;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal diameter;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal roughness;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal crown;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date readyTime;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long delFlag;
|
||||
|
||||
public void setStandbyId(Long standbyId)
|
||||
{
|
||||
this.standbyId = standbyId;
|
||||
}
|
||||
|
||||
public Long getStandbyId()
|
||||
{
|
||||
return standbyId;
|
||||
}
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setStandNo(String standNo)
|
||||
{
|
||||
this.standNo = standNo;
|
||||
}
|
||||
|
||||
public String getStandNo()
|
||||
{
|
||||
return standNo;
|
||||
}
|
||||
|
||||
public void setRollNo(String rollNo)
|
||||
{
|
||||
this.rollNo = rollNo;
|
||||
}
|
||||
|
||||
public String getRollNo()
|
||||
{
|
||||
return rollNo;
|
||||
}
|
||||
|
||||
public void setRollType(String rollType)
|
||||
{
|
||||
this.rollType = rollType;
|
||||
}
|
||||
|
||||
public String getRollType()
|
||||
{
|
||||
return rollType;
|
||||
}
|
||||
|
||||
public void setPosition(String position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setDiameter(BigDecimal diameter)
|
||||
{
|
||||
this.diameter = diameter;
|
||||
}
|
||||
|
||||
public BigDecimal getDiameter()
|
||||
{
|
||||
return diameter;
|
||||
}
|
||||
|
||||
public void setRoughness(BigDecimal roughness)
|
||||
{
|
||||
this.roughness = roughness;
|
||||
}
|
||||
|
||||
public BigDecimal getRoughness()
|
||||
{
|
||||
return roughness;
|
||||
}
|
||||
|
||||
public void setCrown(BigDecimal crown)
|
||||
{
|
||||
this.crown = crown;
|
||||
}
|
||||
|
||||
public BigDecimal getCrown()
|
||||
{
|
||||
return crown;
|
||||
}
|
||||
|
||||
public void setReadyTime(Date readyTime)
|
||||
{
|
||||
this.readyTime = readyTime;
|
||||
}
|
||||
|
||||
public Date getReadyTime()
|
||||
{
|
||||
return readyTime;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("standbyId", getStandbyId())
|
||||
.append("lineId", getLineId())
|
||||
.append("standNo", getStandNo())
|
||||
.append("rollNo", getRollNo())
|
||||
.append("rollType", getRollType())
|
||||
.append("position", getPosition())
|
||||
.append("diameter", getDiameter())
|
||||
.append("roughness", getRoughness())
|
||||
.append("crown", getCrown())
|
||||
.append("readyTime", getReadyTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)VO
|
||||
*/
|
||||
public class MesRollStandbyVo {
|
||||
|
||||
private Long standbyId;
|
||||
private Long lineId;
|
||||
private String standNo;
|
||||
private String rollNo;
|
||||
private String rollType;
|
||||
private String position;
|
||||
/** 辊位中文标签(上支撑辊/上工作辊/下工作辊/下支撑辊) */
|
||||
private String positionLabel;
|
||||
private BigDecimal diameter;
|
||||
private BigDecimal roughness;
|
||||
private BigDecimal crown;
|
||||
private Date readyTime;
|
||||
private String remark;
|
||||
private Date createTime;
|
||||
|
||||
public Long getStandbyId() { return standbyId; }
|
||||
public void setStandbyId(Long standbyId) { this.standbyId = standbyId; }
|
||||
|
||||
public Long getLineId() { return lineId; }
|
||||
public void setLineId(Long lineId) { this.lineId = lineId; }
|
||||
|
||||
public String getStandNo() { return standNo; }
|
||||
public void setStandNo(String standNo) { this.standNo = standNo; }
|
||||
|
||||
public String getRollNo() { return rollNo; }
|
||||
public void setRollNo(String rollNo) { this.rollNo = rollNo; }
|
||||
|
||||
public String getRollType() { return rollType; }
|
||||
public void setRollType(String rollType) { this.rollType = rollType; }
|
||||
|
||||
public String getPosition() { return position; }
|
||||
public void setPosition(String position) { this.position = position; }
|
||||
|
||||
public String getPositionLabel() { return positionLabel; }
|
||||
public void setPositionLabel(String positionLabel) { this.positionLabel = positionLabel; }
|
||||
|
||||
public BigDecimal getDiameter() { return diameter; }
|
||||
public void setDiameter(BigDecimal diameter) { this.diameter = diameter; }
|
||||
|
||||
public BigDecimal getRoughness() { return roughness; }
|
||||
public void setRoughness(BigDecimal roughness) { this.roughness = roughness; }
|
||||
|
||||
public BigDecimal getCrown() { return crown; }
|
||||
public void setCrown(BigDecimal crown) { this.crown = crown; }
|
||||
|
||||
public Date getReadyTime() { return readyTime; }
|
||||
public void setReadyTime(Date readyTime) { this.readyTime = readyTime; }
|
||||
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 钢卷异常信息对象 mill_coil_abnormal
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
public class MillCoilAbnormal extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long abnormalId;
|
||||
|
||||
/** 当前钢卷号 */
|
||||
@Excel(name = "当前钢卷号")
|
||||
private String currentCoilNo;
|
||||
|
||||
/** 产线名称 */
|
||||
@Excel(name = "产线名称")
|
||||
private String productionLine;
|
||||
|
||||
/** 位置(上下,操作侧,中间,驱动侧) */
|
||||
@Excel(name = "位置", readConverterExp = "上=下,操作侧,中间,驱动侧")
|
||||
private String position;
|
||||
|
||||
/** 缺陷长度 */
|
||||
@Excel(name = "缺陷长度")
|
||||
private BigDecimal length;
|
||||
|
||||
/** 缺陷开始位置 */
|
||||
@Excel(name = "缺陷开始位置")
|
||||
private BigDecimal startPosition;
|
||||
|
||||
/** 缺陷结束位置 */
|
||||
@Excel(name = "缺陷结束位置")
|
||||
private BigDecimal endPosition;
|
||||
|
||||
/** 缺陷代码(S=表面缺陷、E=边部问题、M=尺寸问题、G=收卷问题) */
|
||||
@Excel(name = "缺陷代码", readConverterExp = "S==表面缺陷、E=边部问题、M=尺寸问题、G=收卷问题")
|
||||
private String defectCode;
|
||||
|
||||
/** 缺陷类型(更详细的缺陷分类,如划痕、边裂、厚度超标等) */
|
||||
@Excel(name = "缺陷类型", readConverterExp = "更=详细的缺陷分类,如划痕、边裂、厚度超标等")
|
||||
private String defectType;
|
||||
|
||||
/** 缺陷率(百分比,如0.05表示5%) */
|
||||
@Excel(name = "缺陷率", readConverterExp = "百=分比,如0.05表示5%")
|
||||
private BigDecimal defectRate;
|
||||
|
||||
/** 缺陷重量(单位:kg) */
|
||||
@Excel(name = "缺陷重量", readConverterExp = "单=位:kg")
|
||||
private BigDecimal defectWeight;
|
||||
|
||||
/** 程度(轻微、重度、严重) */
|
||||
@Excel(name = "程度", readConverterExp = "轻=微、重度、严重")
|
||||
private String degree;
|
||||
|
||||
/** 判级 */
|
||||
@Excel(name = "判级")
|
||||
private String judgeLevel;
|
||||
|
||||
/** 判级人 */
|
||||
@Excel(name = "判级人")
|
||||
private String judgeBy;
|
||||
|
||||
/** 判级时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "判级时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date judgeTime;
|
||||
|
||||
/** 主标记(1=是,0=否) */
|
||||
@Excel(name = "主标记", readConverterExp = "1==是,0=否")
|
||||
private Long mainMark;
|
||||
|
||||
/** 整卷标记(1=是,0=否) */
|
||||
@Excel(name = "整卷标记", readConverterExp = "1==是,0=否")
|
||||
private Long wholeCoilMark;
|
||||
|
||||
/** 删除标志(0=正常,1=已删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 上下板面 */
|
||||
@Excel(name = "上下板面")
|
||||
private String plateSurface;
|
||||
|
||||
/** 附件路径(多个用英文逗号分隔) */
|
||||
@Excel(name = "附件路径", readConverterExp = "多=个用英文逗号分隔")
|
||||
private String attachmentFiles;
|
||||
|
||||
/** 匹配到的三级系统钢卷ID */
|
||||
@Excel(name = "匹配到的三级系统钢卷ID")
|
||||
private Long thirdCoilId;
|
||||
|
||||
public void setAbnormalId(Long abnormalId)
|
||||
{
|
||||
this.abnormalId = abnormalId;
|
||||
}
|
||||
|
||||
public Long getAbnormalId()
|
||||
{
|
||||
return abnormalId;
|
||||
}
|
||||
|
||||
public void setCurrentCoilNo(String currentCoilNo)
|
||||
{
|
||||
this.currentCoilNo = currentCoilNo;
|
||||
}
|
||||
|
||||
public String getCurrentCoilNo()
|
||||
{
|
||||
return currentCoilNo;
|
||||
}
|
||||
|
||||
public void setProductionLine(String productionLine)
|
||||
{
|
||||
this.productionLine = productionLine;
|
||||
}
|
||||
|
||||
public String getProductionLine()
|
||||
{
|
||||
return productionLine;
|
||||
}
|
||||
|
||||
public void setPosition(String position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setLength(BigDecimal length)
|
||||
{
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public BigDecimal getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setStartPosition(BigDecimal startPosition)
|
||||
{
|
||||
this.startPosition = startPosition;
|
||||
}
|
||||
|
||||
public BigDecimal getStartPosition()
|
||||
{
|
||||
return startPosition;
|
||||
}
|
||||
|
||||
public void setEndPosition(BigDecimal endPosition)
|
||||
{
|
||||
this.endPosition = endPosition;
|
||||
}
|
||||
|
||||
public BigDecimal getEndPosition()
|
||||
{
|
||||
return endPosition;
|
||||
}
|
||||
|
||||
public void setDefectCode(String defectCode)
|
||||
{
|
||||
this.defectCode = defectCode;
|
||||
}
|
||||
|
||||
public String getDefectCode()
|
||||
{
|
||||
return defectCode;
|
||||
}
|
||||
|
||||
public void setDefectType(String defectType)
|
||||
{
|
||||
this.defectType = defectType;
|
||||
}
|
||||
|
||||
public String getDefectType()
|
||||
{
|
||||
return defectType;
|
||||
}
|
||||
|
||||
public void setDefectRate(BigDecimal defectRate)
|
||||
{
|
||||
this.defectRate = defectRate;
|
||||
}
|
||||
|
||||
public BigDecimal getDefectRate()
|
||||
{
|
||||
return defectRate;
|
||||
}
|
||||
|
||||
public void setDefectWeight(BigDecimal defectWeight)
|
||||
{
|
||||
this.defectWeight = defectWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getDefectWeight()
|
||||
{
|
||||
return defectWeight;
|
||||
}
|
||||
|
||||
public void setDegree(String degree)
|
||||
{
|
||||
this.degree = degree;
|
||||
}
|
||||
|
||||
public String getDegree()
|
||||
{
|
||||
return degree;
|
||||
}
|
||||
|
||||
public void setJudgeLevel(String judgeLevel)
|
||||
{
|
||||
this.judgeLevel = judgeLevel;
|
||||
}
|
||||
|
||||
public String getJudgeLevel()
|
||||
{
|
||||
return judgeLevel;
|
||||
}
|
||||
|
||||
public void setJudgeBy(String judgeBy)
|
||||
{
|
||||
this.judgeBy = judgeBy;
|
||||
}
|
||||
|
||||
public String getJudgeBy()
|
||||
{
|
||||
return judgeBy;
|
||||
}
|
||||
|
||||
public void setJudgeTime(Date judgeTime)
|
||||
{
|
||||
this.judgeTime = judgeTime;
|
||||
}
|
||||
|
||||
public Date getJudgeTime()
|
||||
{
|
||||
return judgeTime;
|
||||
}
|
||||
|
||||
public void setMainMark(Long mainMark)
|
||||
{
|
||||
this.mainMark = mainMark;
|
||||
}
|
||||
|
||||
public Long getMainMark()
|
||||
{
|
||||
return mainMark;
|
||||
}
|
||||
|
||||
public void setWholeCoilMark(Long wholeCoilMark)
|
||||
{
|
||||
this.wholeCoilMark = wholeCoilMark;
|
||||
}
|
||||
|
||||
public Long getWholeCoilMark()
|
||||
{
|
||||
return wholeCoilMark;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Integer getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setPlateSurface(String plateSurface)
|
||||
{
|
||||
this.plateSurface = plateSurface;
|
||||
}
|
||||
|
||||
public String getPlateSurface()
|
||||
{
|
||||
return plateSurface;
|
||||
}
|
||||
|
||||
public void setAttachmentFiles(String attachmentFiles)
|
||||
{
|
||||
this.attachmentFiles = attachmentFiles;
|
||||
}
|
||||
|
||||
public String getAttachmentFiles()
|
||||
{
|
||||
return attachmentFiles;
|
||||
}
|
||||
|
||||
public void setThirdCoilId(Long thirdCoilId)
|
||||
{
|
||||
this.thirdCoilId = thirdCoilId;
|
||||
}
|
||||
|
||||
public Long getThirdCoilId()
|
||||
{
|
||||
return thirdCoilId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("abnormalId", getAbnormalId())
|
||||
.append("currentCoilNo", getCurrentCoilNo())
|
||||
.append("productionLine", getProductionLine())
|
||||
.append("position", getPosition())
|
||||
.append("length", getLength())
|
||||
.append("startPosition", getStartPosition())
|
||||
.append("endPosition", getEndPosition())
|
||||
.append("defectCode", getDefectCode())
|
||||
.append("defectType", getDefectType())
|
||||
.append("defectRate", getDefectRate())
|
||||
.append("defectWeight", getDefectWeight())
|
||||
.append("degree", getDegree())
|
||||
.append("judgeLevel", getJudgeLevel())
|
||||
.append("judgeBy", getJudgeBy())
|
||||
.append("judgeTime", getJudgeTime())
|
||||
.append("mainMark", getMainMark())
|
||||
.append("wholeCoilMark", getWholeCoilMark())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("plateSurface", getPlateSurface())
|
||||
.append("attachmentFiles", getAttachmentFiles())
|
||||
.append("thirdCoilId", getThirdCoilId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 二级-三级钢卷异常挂接/撤回关系对象 mill_coil_abnormal_relation
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
public class MillCoilAbnormalRelation extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 关系ID */
|
||||
private Long relationId;
|
||||
|
||||
/** 二级系统异常ID */
|
||||
@Excel(name = "二级系统异常ID")
|
||||
private Long secondAbnormalId;
|
||||
|
||||
/** 三级系统钢卷ID */
|
||||
@Excel(name = "三级系统钢卷ID")
|
||||
private Long thirdCoilId;
|
||||
|
||||
/** 【关键!】三级表的异常ID */
|
||||
@Excel(name = "【关键!】三级表的异常ID")
|
||||
private Long thirdAbnormalId;
|
||||
|
||||
/** 匹配时使用的钢卷号 */
|
||||
@Excel(name = "匹配时使用的钢卷号")
|
||||
private String currentCoilNo;
|
||||
|
||||
/** 状态:1=已挂接,2=已撤回 */
|
||||
@Excel(name = "状态:1=已挂接,2=已撤回")
|
||||
private Long bindStatus;
|
||||
|
||||
/** 挂接时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "挂接时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date bindTime;
|
||||
|
||||
/** 撤回时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "撤回时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date withdrawTime;
|
||||
|
||||
/** 操作人 */
|
||||
@Excel(name = "操作人")
|
||||
private String operateUser;
|
||||
|
||||
/** 操作备注(撤回原因) */
|
||||
@Excel(name = "操作备注", readConverterExp = "撤=回原因")
|
||||
private String operateRemark;
|
||||
|
||||
public void setRelationId(Long relationId)
|
||||
{
|
||||
this.relationId = relationId;
|
||||
}
|
||||
|
||||
public Long getRelationId()
|
||||
{
|
||||
return relationId;
|
||||
}
|
||||
|
||||
public void setSecondAbnormalId(Long secondAbnormalId)
|
||||
{
|
||||
this.secondAbnormalId = secondAbnormalId;
|
||||
}
|
||||
|
||||
public Long getSecondAbnormalId()
|
||||
{
|
||||
return secondAbnormalId;
|
||||
}
|
||||
|
||||
public void setThirdCoilId(Long thirdCoilId)
|
||||
{
|
||||
this.thirdCoilId = thirdCoilId;
|
||||
}
|
||||
|
||||
public Long getThirdCoilId()
|
||||
{
|
||||
return thirdCoilId;
|
||||
}
|
||||
|
||||
public void setThirdAbnormalId(Long thirdAbnormalId)
|
||||
{
|
||||
this.thirdAbnormalId = thirdAbnormalId;
|
||||
}
|
||||
|
||||
public Long getThirdAbnormalId()
|
||||
{
|
||||
return thirdAbnormalId;
|
||||
}
|
||||
|
||||
public void setCurrentCoilNo(String currentCoilNo)
|
||||
{
|
||||
this.currentCoilNo = currentCoilNo;
|
||||
}
|
||||
|
||||
public String getCurrentCoilNo()
|
||||
{
|
||||
return currentCoilNo;
|
||||
}
|
||||
|
||||
public void setBindStatus(Long bindStatus)
|
||||
{
|
||||
this.bindStatus = bindStatus;
|
||||
}
|
||||
|
||||
public Long getBindStatus()
|
||||
{
|
||||
return bindStatus;
|
||||
}
|
||||
|
||||
public void setBindTime(Date bindTime)
|
||||
{
|
||||
this.bindTime = bindTime;
|
||||
}
|
||||
|
||||
public Date getBindTime()
|
||||
{
|
||||
return bindTime;
|
||||
}
|
||||
|
||||
public void setWithdrawTime(Date withdrawTime)
|
||||
{
|
||||
this.withdrawTime = withdrawTime;
|
||||
}
|
||||
|
||||
public Date getWithdrawTime()
|
||||
{
|
||||
return withdrawTime;
|
||||
}
|
||||
|
||||
public void setOperateUser(String operateUser)
|
||||
{
|
||||
this.operateUser = operateUser;
|
||||
}
|
||||
|
||||
public String getOperateUser()
|
||||
{
|
||||
return operateUser;
|
||||
}
|
||||
|
||||
public void setOperateRemark(String operateRemark)
|
||||
{
|
||||
this.operateRemark = operateRemark;
|
||||
}
|
||||
|
||||
public String getOperateRemark()
|
||||
{
|
||||
return operateRemark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("relationId", getRelationId())
|
||||
.append("secondAbnormalId", getSecondAbnormalId())
|
||||
.append("thirdCoilId", getThirdCoilId())
|
||||
.append("thirdAbnormalId", getThirdAbnormalId())
|
||||
.append("currentCoilNo", getCurrentCoilNo())
|
||||
.append("bindStatus", getBindStatus())
|
||||
.append("bindTime", getBindTime())
|
||||
.append("withdrawTime", getWithdrawTime())
|
||||
.append("operateUser", getOperateUser())
|
||||
.append("operateRemark", getOperateRemark())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -126,18 +126,18 @@ public class MillProductionActual extends BaseEntity
|
||||
private String customer;
|
||||
|
||||
/** 上线时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "上线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date onlineTime;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 机组号 */
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 检验任务项目 qc_inspection_item
|
||||
*/
|
||||
@Data
|
||||
public class QcInspectionItem extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long itemId;
|
||||
private Long taskId;
|
||||
private String itemName;
|
||||
private String standardValue;
|
||||
private BigDecimal upperLimit;
|
||||
private BigDecimal lowerLimit;
|
||||
private String unit;
|
||||
private String itemType;
|
||||
private String inspectValue;
|
||||
private Integer isQualified;
|
||||
private String judgeResult;
|
||||
private String inspectUser;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验任务 qc_inspection_task
|
||||
*/
|
||||
@Data
|
||||
public class QcInspectionTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long taskId;
|
||||
private String taskCode;
|
||||
private String taskType;
|
||||
private String belongCompany;
|
||||
private String sourceType;
|
||||
private Long sourceId;
|
||||
private Long schemeId;
|
||||
private String schemeName;
|
||||
private Integer status;
|
||||
private String inspectUser;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectTime;
|
||||
private String auditUser;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
private String result;
|
||||
private String remark;
|
||||
private String coilIds;
|
||||
private String enterCoilNos;
|
||||
private String attachmentFiles;
|
||||
private Integer delFlag;
|
||||
|
||||
// 查询参数
|
||||
private String beginTime;
|
||||
private String endTime;
|
||||
private Long coilId; // 按单个 coilId 过滤
|
||||
|
||||
// 关联数据
|
||||
private List<QcInspectionItem> items;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 钢卷异常 wms_coil_abnormal
|
||||
*/
|
||||
@Data
|
||||
public class WmsCoilAbnormal extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long abnormalId;
|
||||
private Long coilId;
|
||||
private String productionLine;
|
||||
private String position;
|
||||
private String plateSurface;
|
||||
private BigDecimal length;
|
||||
private BigDecimal startPosition;
|
||||
private BigDecimal endPosition;
|
||||
private String defectCode;
|
||||
private String defectType;
|
||||
private BigDecimal defectRate;
|
||||
private BigDecimal defectWeight;
|
||||
private String degree;
|
||||
private String judgeLevel;
|
||||
private String judgeBy;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date judgeTime;
|
||||
private Integer mainMark;
|
||||
private Integer wholeCoilMark;
|
||||
private String attachmentFiles;
|
||||
private Integer delFlag;
|
||||
private Integer sourceSystem;
|
||||
|
||||
// 关联字段
|
||||
private String coilNo; // 从 wms_material_coil 带出
|
||||
|
||||
// 查询参数
|
||||
private String beginTime;
|
||||
private String endTime;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EqpEquipmentChecklistMapper {
|
||||
|
||||
List<EqpEquipmentChecklist> selectEqpChecklistList(EqpEquipmentChecklist checklist);
|
||||
|
||||
EqpEquipmentChecklist selectEqpChecklistByCheckId(Long checkId);
|
||||
|
||||
int insertEqpChecklist(EqpEquipmentChecklist checklist);
|
||||
|
||||
int updateEqpChecklist(EqpEquipmentChecklist checklist);
|
||||
|
||||
int deleteEqpChecklistByCheckId(Long checkId);
|
||||
|
||||
int deleteEqpChecklistByCheckIds(Long[] checkIds);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EqpEquipmentInspectionRecordMapper {
|
||||
|
||||
List<EqpEquipmentInspectionRecord> selectEqpInspectionRecordList(EqpEquipmentInspectionRecord record);
|
||||
|
||||
EqpEquipmentInspectionRecord selectEqpInspectionRecordByRecordId(Long recordId);
|
||||
|
||||
int insertEqpInspectionRecord(EqpEquipmentInspectionRecord record);
|
||||
|
||||
int updateEqpInspectionRecord(EqpEquipmentInspectionRecord record);
|
||||
|
||||
int deleteEqpInspectionRecordByRecordId(Long recordId);
|
||||
|
||||
int deleteEqpInspectionRecordByRecordIds(Long[] recordIds);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentPart;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EqpEquipmentPartMapper {
|
||||
|
||||
List<EqpEquipmentPart> selectEqpPartList(EqpEquipmentPart part);
|
||||
|
||||
EqpEquipmentPart selectEqpPartByPartId(Long partId);
|
||||
|
||||
int insertEqpPart(EqpEquipmentPart part);
|
||||
|
||||
int updateEqpPart(EqpEquipmentPart part);
|
||||
|
||||
int deleteEqpPartByPartId(Long partId);
|
||||
|
||||
int deleteEqpPartByPartIds(Long[] partIds);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.KlpCoilInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface KlpCoilMapper {
|
||||
/** 根据入场钢卷号或当前钢卷号查询钢卷基础信息 */
|
||||
KlpCoilInfo selectByCoilNo(@Param("coilNo") String coilNo);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 换辊记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface MesRollChangeMapper
|
||||
{
|
||||
/**
|
||||
* 查询换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 换辊记录集合
|
||||
*/
|
||||
public List<MesRollChange> selectMesRollChangeList(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 删除换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 批量删除换辊记录
|
||||
*
|
||||
* @param changeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeIds(Long[] changeIds);
|
||||
|
||||
/**
|
||||
* 查询指定机架当前各辊位状态(最近一次换辊记录)
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 各辊位编号+辊径+换辊时间
|
||||
*/
|
||||
public Map<String, Object> selectCurrentStateByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
|
||||
/**
|
||||
* 查询指定机架+辊位的最新换辊记录
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @param posType 辊位类型(upperWr/lowerWr/upperBr/lowerBr)
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectLatestByStandAndPosition(@Param("lineId") Long lineId,
|
||||
@Param("standNo") String standNo,
|
||||
@Param("posType") String posType);
|
||||
|
||||
/**
|
||||
* 统计指定时间范围内的钢卷产量(长度/卷数/重量)
|
||||
*
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间(null表示至今)
|
||||
* @return 统计结果: workLength, coilCount, totalWeight
|
||||
*/
|
||||
public Map<String, Object> selectCoilStats(@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.MesRollGrind;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface MesRollGrindMapper {
|
||||
|
||||
List<MesRollGrind> selectMesRollGrindList(MesRollGrind grind);
|
||||
|
||||
List<MesRollGrind> selectMesRollGrindByRollId(@Param("rollId") Long rollId);
|
||||
|
||||
MesRollGrind selectMesRollGrindById(Long grindId);
|
||||
|
||||
int insertMesRollGrind(MesRollGrind grind);
|
||||
|
||||
int updateMesRollGrind(MesRollGrind grind);
|
||||
|
||||
int deleteMesRollGrindById(Long grindId);
|
||||
|
||||
List<Map<String, Object>> selectMonthlyStats(@Param("rollId") Long rollId, @Param("year") int year);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.MesRollInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface MesRollInfoMapper {
|
||||
|
||||
List<MesRollInfo> selectMesRollInfoList(MesRollInfo rollInfo);
|
||||
|
||||
MesRollInfo selectMesRollInfoById(Long rollId);
|
||||
|
||||
MesRollInfo selectMesRollInfoByRollNo(@Param("rollNo") String rollNo);
|
||||
|
||||
int insertMesRollInfo(MesRollInfo rollInfo);
|
||||
|
||||
int updateMesRollInfo(MesRollInfo rollInfo);
|
||||
|
||||
int deleteMesRollInfoById(Long rollId);
|
||||
|
||||
int deleteMesRollInfoByIds(Long[] rollIds);
|
||||
|
||||
List<Map<String, Object>> selectStatusStats(@Param("lineId") Long lineId);
|
||||
|
||||
List<String> selectRollNoList(@Param("lineId") Long lineId,
|
||||
@Param("rollType") String rollType,
|
||||
@Param("status") String status);
|
||||
|
||||
int updateStatusByRollNo(@Param("rollNo") String rollNo, @Param("status") String status);
|
||||
|
||||
int incrementGrindCount(@Param("rollId") Long rollId, @Param("diaAfter") BigDecimal diaAfter);
|
||||
|
||||
int updateCurrentDia(@Param("rollId") Long rollId, @Param("currentDia") BigDecimal currentDia);
|
||||
|
||||
/**
|
||||
* 条件更新:仅当辊当前状态等于 onlyIfStatus 时才更新(用于避免误覆盖已 Online 的辊)
|
||||
*/
|
||||
int updateStatusByRollNoIfStatus(@Param("rollNo") String rollNo,
|
||||
@Param("status") String status,
|
||||
@Param("onlyIfStatus") String onlyIfStatus);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mill.domain.MesRollStandby;
|
||||
import com.ruoyi.mill.domain.MesRollStandbyVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface MesRollStandbyMapper
|
||||
{
|
||||
/**
|
||||
* 查询下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 下批轧辊(待换上)
|
||||
*/
|
||||
public MesRollStandby selectMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 下批轧辊(待换上)集合
|
||||
*/
|
||||
public List<MesRollStandby> selectMesRollStandbyList(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 批量删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyIds(Long[] standbyIds);
|
||||
|
||||
/**
|
||||
* 查询指定机架的所有备辊
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 备辊列表 (VO)
|
||||
*/
|
||||
public List<MesRollStandbyVo> selectByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
|
||||
/**
|
||||
* 清空指定机架的所有备辊记录
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int clearByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mill.domain.MillCoilAbnormal;
|
||||
|
||||
/**
|
||||
* 钢卷异常信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
public interface MillCoilAbnormalMapper
|
||||
{
|
||||
/**
|
||||
* 查询钢卷异常信息
|
||||
*
|
||||
* @param abnormalId 钢卷异常信息主键
|
||||
* @return 钢卷异常信息
|
||||
*/
|
||||
public MillCoilAbnormal selectMillCoilAbnormalByAbnormalId(Long abnormalId);
|
||||
|
||||
/**
|
||||
* 查询钢卷异常信息列表
|
||||
*
|
||||
* @param millCoilAbnormal 钢卷异常信息
|
||||
* @return 钢卷异常信息集合
|
||||
*/
|
||||
public List<MillCoilAbnormal> selectMillCoilAbnormalList(MillCoilAbnormal millCoilAbnormal);
|
||||
|
||||
/**
|
||||
* 新增钢卷异常信息
|
||||
*
|
||||
* @param millCoilAbnormal 钢卷异常信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
|
||||
|
||||
/**
|
||||
* 修改钢卷异常信息
|
||||
*
|
||||
* @param millCoilAbnormal 钢卷异常信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
|
||||
|
||||
/**
|
||||
* 删除钢卷异常信息
|
||||
*
|
||||
* @param abnormalId 钢卷异常信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMillCoilAbnormalByAbnormalId(Long abnormalId);
|
||||
|
||||
/**
|
||||
* 批量删除钢卷异常信息
|
||||
*
|
||||
* @param abnormalIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMillCoilAbnormalByAbnormalIds(Long[] abnormalIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mill.domain.MillCoilAbnormalRelation;
|
||||
|
||||
/**
|
||||
* 二级-三级钢卷异常挂接/撤回关系Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-03
|
||||
*/
|
||||
public interface MillCoilAbnormalRelationMapper
|
||||
{
|
||||
/**
|
||||
* 查询二级-三级钢卷异常挂接/撤回关系
|
||||
*
|
||||
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
|
||||
* @return 二级-三级钢卷异常挂接/撤回关系
|
||||
*/
|
||||
public MillCoilAbnormalRelation selectMillCoilAbnormalRelationByRelationId(Long relationId);
|
||||
|
||||
/**
|
||||
* 查询二级-三级钢卷异常挂接/撤回关系列表
|
||||
*
|
||||
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
|
||||
* @return 二级-三级钢卷异常挂接/撤回关系集合
|
||||
*/
|
||||
public List<MillCoilAbnormalRelation> selectMillCoilAbnormalRelationList(MillCoilAbnormalRelation millCoilAbnormalRelation);
|
||||
|
||||
/**
|
||||
* 新增二级-三级钢卷异常挂接/撤回关系
|
||||
*
|
||||
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
|
||||
|
||||
/**
|
||||
* 修改二级-三级钢卷异常挂接/撤回关系
|
||||
*
|
||||
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
|
||||
|
||||
/**
|
||||
* 删除二级-三级钢卷异常挂接/撤回关系
|
||||
*
|
||||
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMillCoilAbnormalRelationByRelationId(Long relationId);
|
||||
|
||||
/**
|
||||
* 批量删除二级-三级钢卷异常挂接/撤回关系
|
||||
*
|
||||
* @param relationIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMillCoilAbnormalRelationByRelationIds(Long[] relationIds);
|
||||
}
|
||||
@@ -27,6 +27,14 @@ public interface MillProductionActualMapper
|
||||
*/
|
||||
public List<MillProductionActual> selectMillProductionActualList(MillProductionActual millProductionActual);
|
||||
|
||||
/**
|
||||
* 查询某计划是否已生成实绩
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @return 数量
|
||||
*/
|
||||
public int countByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 新增轧线生产实绩
|
||||
*
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.QcInspectionItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QcInspectionItemMapper {
|
||||
|
||||
List<QcInspectionItem> selectQcInspectionItemList(QcInspectionItem item);
|
||||
|
||||
List<QcInspectionItem> selectQcInspectionItemByTaskId(Long taskId);
|
||||
|
||||
QcInspectionItem selectQcInspectionItemById(Long itemId);
|
||||
|
||||
int insertQcInspectionItem(QcInspectionItem item);
|
||||
|
||||
int updateQcInspectionItem(QcInspectionItem item);
|
||||
|
||||
int deleteQcInspectionItemById(Long itemId);
|
||||
|
||||
int deleteQcInspectionItemByTaskId(Long taskId);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.QcInspectionTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QcInspectionTaskMapper {
|
||||
|
||||
List<QcInspectionTask> selectQcInspectionTaskList(QcInspectionTask task);
|
||||
|
||||
List<QcInspectionTask> selectQcInspectionTaskListByCoilIds(@Param("task") QcInspectionTask task,
|
||||
@Param("coilIds") List<Long> coilIds);
|
||||
|
||||
QcInspectionTask selectQcInspectionTaskById(Long taskId);
|
||||
|
||||
int insertQcInspectionTask(QcInspectionTask task);
|
||||
|
||||
int updateQcInspectionTask(QcInspectionTask task);
|
||||
|
||||
int deleteQcInspectionTaskById(Long taskId);
|
||||
|
||||
int deleteQcInspectionTaskByIds(Long[] taskIds);
|
||||
|
||||
/** 获取所有 processed_coil_ids 字符串(来自双机架 action 类型) */
|
||||
List<String> selectDoubleRackProcessedCoilIds(@Param("actionTypes") List<Integer> actionTypes);
|
||||
|
||||
/** 按 coilId 列表查询钢卷基本信息(coilId + current_coil_no) */
|
||||
List<java.util.Map<String, Object>> selectCoilInfoByIds(@Param("coilIds") List<Long> coilIds);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import com.ruoyi.mill.domain.WmsCoilAbnormal;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WmsCoilAbnormalMapper {
|
||||
|
||||
List<WmsCoilAbnormal> selectWmsCoilAbnormalList(WmsCoilAbnormal abnormal);
|
||||
|
||||
List<WmsCoilAbnormal> selectWmsCoilAbnormalListByCoilIds(@Param("abnormal") WmsCoilAbnormal abnormal,
|
||||
@Param("coilIds") List<Long> coilIds);
|
||||
|
||||
WmsCoilAbnormal selectWmsCoilAbnormalById(Long abnormalId);
|
||||
|
||||
int insertWmsCoilAbnormal(WmsCoilAbnormal abnormal);
|
||||
|
||||
int updateWmsCoilAbnormal(WmsCoilAbnormal abnormal);
|
||||
|
||||
int deleteWmsCoilAbnormalById(Long abnormalId);
|
||||
|
||||
int deleteWmsCoilAbnormalByIds(Long[] abnormalIds);
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.ruoyi.mill.protocol;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 新协议编解码器
|
||||
*
|
||||
* 帧格式:
|
||||
* [4字节 LITTLE_ENDIAN] ID (uint32)
|
||||
* [4字节 LITTLE_ENDIAN] 数据体字节数 (uint32)
|
||||
* [N字节] 数据体
|
||||
*
|
||||
* 数据体字段编码规则(全部小端存储):
|
||||
* I4 → 4字节有符号整数
|
||||
* I2 → 2字节有符号整数
|
||||
* F4 → 4字节 IEEE-754 单精度浮点
|
||||
* 位字段从所属 I4 字段中按位提取(bit0 = LSB)
|
||||
*/
|
||||
public final class MillDataCodec {
|
||||
|
||||
private MillDataCodec() {}
|
||||
|
||||
// ── 编码 ──────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* 编码完整报文(含8字节头)
|
||||
*/
|
||||
public static byte[] encodePacket(int id, List<MillDataField> schema, Map<String, Object> values) {
|
||||
byte[] body = encodeBody(schema, values);
|
||||
ByteBuffer buf = ByteBuffer.allocate(8 + body.length).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.putInt(id);
|
||||
buf.putInt(body.length);
|
||||
buf.put(body);
|
||||
return buf.array();
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅编码数据体(不含头)
|
||||
*/
|
||||
public static byte[] encodeBody(List<MillDataField> schema, Map<String, Object> values) {
|
||||
int totalLen = schema.stream().mapToInt(MillDataField::byteLength).sum();
|
||||
ByteBuffer buf = ByteBuffer.allocate(totalLen).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
for (MillDataField field : schema) {
|
||||
switch (field.getType()) {
|
||||
case I4: {
|
||||
int intVal;
|
||||
if (field.hasBits()) {
|
||||
intVal = 0;
|
||||
for (Map.Entry<Integer, String> e : field.getBitNames().entrySet()) {
|
||||
Object bitVal = values.get(e.getValue());
|
||||
if (isTruthy(bitVal)) {
|
||||
intVal |= (1 << e.getKey());
|
||||
}
|
||||
}
|
||||
// 如果也直接提供了整数值,以整数值为准
|
||||
Object raw = values.get(field.getName());
|
||||
if (raw instanceof Number) intVal = ((Number) raw).intValue();
|
||||
} else {
|
||||
Object raw = values.getOrDefault(field.getName(), 0);
|
||||
intVal = raw instanceof Number ? ((Number) raw).intValue() : 0;
|
||||
}
|
||||
buf.putInt(intVal);
|
||||
break;
|
||||
}
|
||||
case I2: {
|
||||
Object raw = values.getOrDefault(field.getName(), 0);
|
||||
short shortVal = raw instanceof Number ? ((Number) raw).shortValue() : 0;
|
||||
buf.putShort(shortVal);
|
||||
break;
|
||||
}
|
||||
case F4: {
|
||||
Object raw = values.getOrDefault(field.getName(), 0f);
|
||||
float floatVal = raw instanceof Number ? ((Number) raw).floatValue() : 0f;
|
||||
buf.putFloat(floatVal);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return buf.array();
|
||||
}
|
||||
|
||||
// ── 解码 ──────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* 解码完整报文,返回头信息 + 字段值Map
|
||||
* @return id→packetId, dataLength→body字节数, fields→字段Map
|
||||
*/
|
||||
public static Map<String, Object> decodePacket(byte[] data, Map<Integer, List<MillDataField>> schemas) {
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
if (data.length < 8) {
|
||||
result.put("error", "报文过短,至少需要8字节头");
|
||||
return result;
|
||||
}
|
||||
ByteBuffer buf = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN);
|
||||
int id = buf.getInt();
|
||||
int dataLen = buf.getInt();
|
||||
|
||||
result.put("id", id);
|
||||
result.put("dataLength", dataLen);
|
||||
|
||||
int bodyLen = Math.min(dataLen, data.length - 8);
|
||||
byte[] body = new byte[bodyLen];
|
||||
buf.get(body);
|
||||
result.put("rawBody", body);
|
||||
|
||||
List<MillDataField> schema = schemas != null ? schemas.get(id) : null;
|
||||
if (schema != null) {
|
||||
Map<String, Object> fields = decodeBody(schema, body);
|
||||
result.put("fields", fields);
|
||||
result.put("schemaMatched", true);
|
||||
} else {
|
||||
result.put("schemaMatched", false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅解码数据体
|
||||
*/
|
||||
public static Map<String, Object> decodeBody(List<MillDataField> schema, byte[] body) {
|
||||
ByteBuffer buf = ByteBuffer.wrap(body).order(ByteOrder.LITTLE_ENDIAN);
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
|
||||
for (MillDataField field : schema) {
|
||||
if (buf.remaining() < field.byteLength()) break;
|
||||
switch (field.getType()) {
|
||||
case I4: {
|
||||
int val = buf.getInt();
|
||||
result.put(field.getName(), val);
|
||||
if (field.hasBits()) {
|
||||
for (Map.Entry<Integer, String> e : field.getBitNames().entrySet()) {
|
||||
result.put(e.getValue(), (val >> e.getKey()) & 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case I2: {
|
||||
result.put(field.getName(), (int) buf.getShort());
|
||||
break;
|
||||
}
|
||||
case F4: {
|
||||
result.put(field.getName(), buf.getFloat());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// ── 工具方法 ──────────────────────────────────────────────────────
|
||||
|
||||
/** 将字节数组转为16进制字符串(含空格) */
|
||||
public static String toHexString(byte[] data) {
|
||||
if (data == null || data.length == 0) return "";
|
||||
StringBuilder sb = new StringBuilder(data.length * 3);
|
||||
for (byte b : data) {
|
||||
sb.append(String.format("%02X ", b));
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
/** 读取报文头中的ID(前4字节LE),不足则返回-1 */
|
||||
public static int peekId(byte[] data) {
|
||||
if (data == null || data.length < 4) return -1;
|
||||
return ByteBuffer.wrap(data, 0, 4).order(ByteOrder.LITTLE_ENDIAN).getInt();
|
||||
}
|
||||
|
||||
private static boolean isTruthy(Object val) {
|
||||
if (val == null) return false;
|
||||
if (val instanceof Boolean) return (Boolean) val;
|
||||
if (val instanceof Number) return ((Number) val).intValue() != 0;
|
||||
if (val instanceof String) return "1".equals(val) || "true".equalsIgnoreCase((String) val);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.mill.protocol;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 新协议字段定义
|
||||
* 报文格式:[4字节LE ID][4字节LE 数据长度][数据体]
|
||||
* 数据体:每个字段小端存储
|
||||
*/
|
||||
public class MillDataField {
|
||||
|
||||
public enum DataType {
|
||||
I4, // 4字节有符号整数(小端)
|
||||
I2, // 2字节有符号整数(小端)
|
||||
F4 // 4字节IEEE-754单精度浮点(小端)
|
||||
}
|
||||
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final String unit;
|
||||
private final DataType type;
|
||||
// I4类型可含位字段:index→bitName,index→bitDescription
|
||||
private final Map<Integer, String> bitNames;
|
||||
private final Map<Integer, String> bitDescriptions;
|
||||
|
||||
private MillDataField(String name, String description, String unit, DataType type,
|
||||
Map<Integer, String> bitNames, Map<Integer, String> bitDescriptions) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.unit = unit;
|
||||
this.type = type;
|
||||
this.bitNames = bitNames != null ? Collections.unmodifiableMap(bitNames) : Collections.emptyMap();
|
||||
this.bitDescriptions = bitDescriptions != null ? Collections.unmodifiableMap(bitDescriptions) : Collections.emptyMap();
|
||||
}
|
||||
|
||||
public static MillDataField i4(String name, String description, String unit) {
|
||||
return new MillDataField(name, description, unit, DataType.I4, null, null);
|
||||
}
|
||||
|
||||
public static MillDataField i4WithBits(String name, String description,
|
||||
Map<Integer, String> bitNames,
|
||||
Map<Integer, String> bitDescriptions) {
|
||||
return new MillDataField(name, description, "", DataType.I4, bitNames, bitDescriptions);
|
||||
}
|
||||
|
||||
public static MillDataField i2(String name, String description, String unit) {
|
||||
return new MillDataField(name, description, unit, DataType.I2, null, null);
|
||||
}
|
||||
|
||||
public static MillDataField f4(String name, String description, String unit) {
|
||||
return new MillDataField(name, description, unit, DataType.F4, null, null);
|
||||
}
|
||||
|
||||
public int byteLength() {
|
||||
return type == DataType.I2 ? 2 : 4;
|
||||
}
|
||||
|
||||
public boolean hasBits() {
|
||||
return !bitNames.isEmpty();
|
||||
}
|
||||
|
||||
public String getName() { return name; }
|
||||
public String getDescription() { return description; }
|
||||
public String getUnit() { return unit; }
|
||||
public DataType getType() { return type; }
|
||||
public Map<Integer, String> getBitNames() { return bitNames; }
|
||||
public Map<Integer, String> getBitDescriptions() { return bitDescriptions; }
|
||||
|
||||
/** 构建位字段Map的便捷方法 */
|
||||
public static Map<Integer, String> bits(Object... indexAndName) {
|
||||
Map<Integer, String> map = new LinkedHashMap<>();
|
||||
for (int i = 0; i + 1 < indexAndName.length; i += 2) {
|
||||
map.put((Integer) indexAndName[i], (String) indexAndName[i + 1]);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.ruoyi.mill.protocol;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.mill.protocol.MillDataField.*;
|
||||
|
||||
/**
|
||||
* 新协议报文 Schema 定义
|
||||
*
|
||||
* 报文帧结构:
|
||||
* [4字节 LE] ID
|
||||
* [4字节 LE] 数据体长度
|
||||
* [N字节] 数据体(各字段小端存储)
|
||||
*
|
||||
* ID=1202 (0x000004B2):100ms周期发送,数据体138字节
|
||||
* no.1 counter I4 4B offset=0
|
||||
* no.2 passNo I2 2B offset=4 (道次号)
|
||||
* no.3 rolledLength F4 4B offset=6 (当前道次轧制长度 m)
|
||||
* no.4 entryCoilerLen F4 4B offset=10
|
||||
* no.5 exitCoilerLen F4 4B offset=14
|
||||
* no.6 millStatus I4 4B offset=18 (含9个位字段 bit0~bit8)
|
||||
* no.7 entryThick F4 4B offset=22 (入口厚度设定值 mm)
|
||||
* no.8 entryThickDev F4 4B offset=26 (入口厚度偏差 mm)
|
||||
* no.9 exitThick F4 4B offset=30
|
||||
* no.10 exitThickDev F4 4B offset=34
|
||||
* no.11 topLimit F4 4B offset=38 (偏差上限 %)
|
||||
* no.12 botLimit F4 4B offset=42 (偏差下限 %)
|
||||
* no.13 ffSc F4 4B offset=46 (前馈辊缝修正)
|
||||
* no.14 spare14 F4 4B offset=50 (备用)
|
||||
* no.15 fbSc F4 4B offset=54 (反馈辊缝修正)
|
||||
* no.16 mfSc F4 4B offset=58 (秒流量辊缝修正)
|
||||
* no.17 entryTension F4 4B offset=62 (kN)
|
||||
* no.18 entryTensionDiff F4 4B offset=66
|
||||
* no.19 exitTension F4 4B offset=70
|
||||
* no.20 exitTensionDiff F4 4B offset=74
|
||||
* no.21 entrySpeed F4 4B offset=78 (m/min)
|
||||
* no.22 exitSpeed F4 4B offset=82
|
||||
* no.23 standSpeed F4 4B offset=86
|
||||
* no.24 rollForce F4 4B offset=90 (kN)
|
||||
* no.25 rollForceDiff F4 4B offset=94
|
||||
* no.26 rollgap F4 4B offset=98 (mm)
|
||||
* no.27 rollgapDiff F4 4B offset=102
|
||||
* no.28 forwardslip F4 4B offset=106
|
||||
* no.29 power F4 4B offset=110 (kW)
|
||||
* no.30 torque F4 4B offset=114 (kNm)
|
||||
* no.31 irbendMeasure F4 4B offset=118 (kN)
|
||||
* no.32 irbendReference F4 4B offset=122
|
||||
* no.33 wrbendMeasure F4 4B offset=126
|
||||
* no.34 wrbendReference F4 4B offset=130
|
||||
* no.35 irshift F4 4B offset=134 (mm)
|
||||
* Total: 138 bytes
|
||||
*/
|
||||
public final class MillDataSchema {
|
||||
|
||||
private MillDataSchema() {}
|
||||
|
||||
public static final int ID_1202 = 1202;
|
||||
|
||||
public static final List<MillDataField> SCHEMA_1202 = Collections.unmodifiableList(Arrays.asList(
|
||||
// no.1
|
||||
i4("counter", "计数器", "-"),
|
||||
// no.2 I2 = 2字节
|
||||
i2("passNo", "道次号", "-"),
|
||||
// no.3~5
|
||||
f4("rolledLength", "当前道次轧制长度", "m"),
|
||||
f4("entryCoilerLen", "入口卷取机长度", "m"),
|
||||
f4("exitCoilerLen", "出口卷取机长度", "m"),
|
||||
// no.6 I4含位字段
|
||||
i4WithBits("millStatus", "轧机状态",
|
||||
bits(
|
||||
0, "millDecelerating",
|
||||
1, "millAccelerating",
|
||||
2, "entryGaugeMeterHealthy",
|
||||
3, "exitGaugeMeterHealthy",
|
||||
4, "entrySpeedMeterHealthy",
|
||||
5, "exitSpeedMeterHealthy"
|
||||
),
|
||||
bits(
|
||||
0, "轧机减速中",
|
||||
1, "轧机加速中",
|
||||
2, "入口测厚仪健康",
|
||||
3, "出口测厚仪健康",
|
||||
4, "入口测速仪健康",
|
||||
5, "出口测速仪健康"
|
||||
)
|
||||
),
|
||||
// no.7~13
|
||||
f4("entryThick", "入口厚度设定值", "mm"),
|
||||
f4("entryThickDev", "入口厚度偏差", "mm"),
|
||||
f4("exitThick", "出口厚度", "mm"),
|
||||
f4("exitThickDev", "出口厚度偏差", "mm"),
|
||||
f4("topLimit", "偏差上限", "%"),
|
||||
f4("botLimit", "偏差下限", "%"),
|
||||
f4("ffSc", "前馈辊缝修正", ""),
|
||||
// no.14 备用
|
||||
f4("spare14", "备用字段14", ""),
|
||||
// no.15~16
|
||||
f4("fbSc", "反馈辊缝修正", ""),
|
||||
f4("mfSc", "秒流量辊缝修正", ""),
|
||||
// no.17~20
|
||||
f4("entryTension", "入口张力", "kN"),
|
||||
f4("entryTensionDiff", "入口张力差", "kN"),
|
||||
f4("exitTension", "出口张力", "kN"),
|
||||
f4("exitTensionDiff", "出口张力差", "kN"),
|
||||
// no.21~23
|
||||
f4("entrySpeed", "入口速度", "m/min"),
|
||||
f4("exitSpeed", "出口速度", "m/min"),
|
||||
f4("standSpeed", "机架速度", "m/min"),
|
||||
// no.24~27
|
||||
f4("rollForce", "轧制力", "kN"),
|
||||
f4("rollForceDiff", "轧制力差", "kN"),
|
||||
f4("rollgap", "辊缝", "mm"),
|
||||
f4("rollgapDiff", "辊缝差", "mm"),
|
||||
// no.28~30
|
||||
f4("forwardslip", "前滑值", ""),
|
||||
f4("power", "功率", "kW"),
|
||||
f4("torque", "扭矩", "kNm"),
|
||||
// no.31~35
|
||||
f4("irbendMeasure", "工作辊弯辊实测", "kN"),
|
||||
f4("irbendReference", "工作辊弯辊设定", "kN"),
|
||||
f4("wrbendMeasure", "支撑辊弯辊实测", "kN"),
|
||||
f4("wrbendReference", "支撑辊弯辊设定", "kN"),
|
||||
f4("irshift", "工作辊横移", "mm")
|
||||
));
|
||||
|
||||
// ── Schema 注册表 ──────────────────────────────────────────────────
|
||||
private static final Map<Integer, List<MillDataField>> SCHEMA_MAP;
|
||||
private static final Map<Integer, String> ID_DESCRIPTIONS;
|
||||
|
||||
static {
|
||||
Map<Integer, List<MillDataField>> m = new LinkedHashMap<>();
|
||||
m.put(ID_1202, SCHEMA_1202);
|
||||
SCHEMA_MAP = Collections.unmodifiableMap(m);
|
||||
|
||||
Map<Integer, String> d = new LinkedHashMap<>();
|
||||
d.put(ID_1202, "100ms周期数据(轧机实时状态)");
|
||||
ID_DESCRIPTIONS = Collections.unmodifiableMap(d);
|
||||
}
|
||||
|
||||
public static List<MillDataField> getSchema(int id) {
|
||||
return SCHEMA_MAP.get(id);
|
||||
}
|
||||
|
||||
public static Map<Integer, List<MillDataField>> getAllSchemas() {
|
||||
return SCHEMA_MAP;
|
||||
}
|
||||
|
||||
public static Map<Integer, String> getIdDescriptions() {
|
||||
return ID_DESCRIPTIONS;
|
||||
}
|
||||
|
||||
public static boolean isKnownId(int id) {
|
||||
return SCHEMA_MAP.containsKey(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IEqpEquipmentChecklistService {
|
||||
|
||||
List<EqpEquipmentChecklist> selectEqpChecklistList(EqpEquipmentChecklist checklist);
|
||||
|
||||
EqpEquipmentChecklist selectEqpChecklistByCheckId(Long checkId);
|
||||
|
||||
int insertEqpChecklist(EqpEquipmentChecklist checklist);
|
||||
|
||||
int updateEqpChecklist(EqpEquipmentChecklist checklist);
|
||||
|
||||
int deleteEqpChecklistByCheckIds(Long[] checkIds);
|
||||
|
||||
int deleteEqpChecklistByCheckId(Long checkId);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IEqpEquipmentInspectionRecordService {
|
||||
|
||||
List<EqpEquipmentInspectionRecord> selectEqpInspectionRecordList(EqpEquipmentInspectionRecord record);
|
||||
|
||||
EqpEquipmentInspectionRecord selectEqpInspectionRecordByRecordId(Long recordId);
|
||||
|
||||
int insertEqpInspectionRecord(EqpEquipmentInspectionRecord record);
|
||||
|
||||
int updateEqpInspectionRecord(EqpEquipmentInspectionRecord record);
|
||||
|
||||
int deleteEqpInspectionRecordByRecordIds(Long[] recordIds);
|
||||
|
||||
int deleteEqpInspectionRecordByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import com.ruoyi.mill.domain.EqpEquipmentPart;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IEqpEquipmentPartService {
|
||||
|
||||
List<EqpEquipmentPart> selectEqpPartList(EqpEquipmentPart part);
|
||||
|
||||
EqpEquipmentPart selectEqpPartByPartId(Long partId);
|
||||
|
||||
int insertEqpPart(EqpEquipmentPart part);
|
||||
|
||||
int updateEqpPart(EqpEquipmentPart part);
|
||||
|
||||
int deleteEqpPartByPartIds(Long[] partIds);
|
||||
|
||||
int deleteEqpPartByPartId(Long partId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import com.ruoyi.mill.domain.KlpCoilInfo;
|
||||
|
||||
public interface IKlpCoilService {
|
||||
/** 根据入场钢卷号或当前钢卷号查询三级 WMS 钢卷信息 */
|
||||
KlpCoilInfo queryByCoilNo(String coilNo);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import com.ruoyi.mill.domain.MesRollChangeVo;
|
||||
|
||||
/**
|
||||
* 换辊记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface IMesRollChangeService
|
||||
{
|
||||
/**
|
||||
* 查询换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 换辊记录集合
|
||||
*/
|
||||
public List<MesRollChange> selectMesRollChangeList(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 批量删除换辊记录
|
||||
*
|
||||
* @param changeIds 需要删除的换辊记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeIds(Long[] changeIds);
|
||||
|
||||
/**
|
||||
* 删除换辊记录信息
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询指定产线+机架当前在机轧辊
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 在机轧辊 VO
|
||||
*/
|
||||
public MesRollChangeVo queryCurrentByStand(Long lineId, String standNo);
|
||||
|
||||
/**
|
||||
* 查询指定产线各机架各辊位实时工作绩效
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @return 各位置类型→各机架→统计数据
|
||||
*/
|
||||
public Map<String, Map<String, Object>> queryRollPerformance(Long lineId);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user