mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-28 04:31:57 +08:00
强化文件api,添加FilePond
This commit is contained in:
@@ -59,12 +59,6 @@
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Api System -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
@@ -82,6 +76,12 @@
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-services</artifactId>
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>com.ruoyi</groupId>-->
|
||||
<!-- <artifactId>ruoyi-common-log</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Datasource-->
|
||||
@@ -89,7 +89,19 @@
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- RuoYi Common Core -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.ruoyi</groupId>-->
|
||||
<!-- <artifactId>ruoyi-common-security</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- <!– 系统接口 –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.ruoyi</groupId>-->
|
||||
<!-- <artifactId>ruoyi-api-system</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.file;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -13,6 +14,7 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
*/
|
||||
@ConditionalOnProperty(name = "spring.cloud.nacos.config.group", havingValue = "DEFAULT_GROUP", matchIfMissing = true)
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class RuoYiFileApplication {
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.file.domain.SysFile;
|
||||
import com.ruoyi.file.service.ISysFileCRUDService;
|
||||
@@ -43,6 +45,10 @@ public class SysFileCRUDController extends BaseController {
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysFile sysFile) {
|
||||
List<SysFile> list = crudService.selectSysFileList(sysFile);
|
||||
if (list.isEmpty()) {
|
||||
responseJsonWarn(response, "没有数据可以导出");
|
||||
return;
|
||||
}
|
||||
ExcelUtil<SysFile> util = new ExcelUtil<>(SysFile.class);
|
||||
util.exportExcel(response, list, "文件存储记录数据");
|
||||
}
|
||||
@@ -55,4 +61,34 @@ public class SysFileCRUDController extends BaseController {
|
||||
public AjaxResult getInfo(@PathVariable("fileId") String fileId) {
|
||||
return success(crudService.selectSysFileByFileId(fileId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件存储记录
|
||||
*/
|
||||
@RequiresPermissions("wms:FileRecord:add")
|
||||
@Log(title = "文件存储记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysFile sysFile) {
|
||||
return toAjax(crudService.insertSysFile(sysFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件存储记录
|
||||
*/
|
||||
@RequiresPermissions("wms:FileRecord:edit")
|
||||
@Log(title = "文件存储记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysFile sysFile) {
|
||||
return toAjax(crudService.updateSysFile(sysFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件存储记录
|
||||
*/
|
||||
@RequiresPermissions("wms:FileRecord:remove")
|
||||
@Log(title = "文件存储记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{fileIds}")
|
||||
public AjaxResult remove(@PathVariable String[] fileIds) throws Exception {
|
||||
return toAjax(crudService.deleteSysFileByFileIds(fileIds));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.ruoyi.file.controller;
|
||||
|
||||
import com.ruoyi.file.domain.FileSaveResult;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -32,7 +33,7 @@ public class SysFileController {
|
||||
public R<SysFileInfo> upload(MultipartFile file) {
|
||||
try {
|
||||
// 上传并返回访问地址
|
||||
FileSaveResult saveResult = sysFileService.uploadFile(file);
|
||||
FileResult saveResult = sysFileService.uploadFile(file);
|
||||
String requestUrl = saveResult.getRequestUrl();
|
||||
// 构建返回结果
|
||||
SysFileInfo responseInfo = new SysFileInfo();
|
||||
@@ -45,4 +46,18 @@ public class SysFileController {
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
@PostMapping("deleteFiles/{fileIds}")
|
||||
public R<SysFileInfo> deleteFiles(@PathVariable String[] fileIds) {
|
||||
try {
|
||||
FileResult fileResult = sysFileService.deleteFiles(fileIds);
|
||||
return fileResult.isSuccess() ? R.ok() : R.fail(fileResult.getMessage("删除文件失败"));
|
||||
} catch (Exception e) {
|
||||
log.error("删除文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.file.domain;
|
||||
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -10,7 +11,7 @@ import java.io.Serializable;
|
||||
* created on 2024/2/19
|
||||
*/
|
||||
@Data
|
||||
public class FileSaveResult implements Serializable {
|
||||
public class FileResult implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -19,6 +20,8 @@ public class FileSaveResult implements Serializable {
|
||||
|
||||
private String message;
|
||||
|
||||
private int count;
|
||||
|
||||
/**
|
||||
* 文件请求地址
|
||||
*/
|
||||
@@ -33,19 +36,30 @@ public class FileSaveResult implements Serializable {
|
||||
return uploadResult == null ? "" : uploadResult.getFileId();
|
||||
}
|
||||
|
||||
public static FileSaveResult success(String requestUrl, FileUploadResult uploadResult) {
|
||||
FileSaveResult result = new FileSaveResult();
|
||||
public static FileResult success(String requestUrl, FileUploadResult uploadResult) {
|
||||
FileResult result = new FileResult();
|
||||
result.setSuccess(true);
|
||||
result.setRequestUrl(requestUrl);
|
||||
result.setUploadResult(uploadResult);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static FileSaveResult fail(String message) {
|
||||
FileSaveResult result = new FileSaveResult();
|
||||
public static FileResult success(String requestUrl) {
|
||||
return success(requestUrl, null);
|
||||
}
|
||||
|
||||
public static FileResult success() {
|
||||
return success(null, null);
|
||||
}
|
||||
|
||||
public static FileResult fail(String message) {
|
||||
FileResult result = new FileResult();
|
||||
result.setSuccess(false);
|
||||
result.setMessage(message);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getMessage(String defaultMessage) {
|
||||
return StringUtils.isBlank(message) ? defaultMessage : message;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.file.service;
|
||||
|
||||
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
||||
import com.ruoyi.file.domain.FileSaveResult;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -29,12 +29,17 @@ public class FastDfsSysFileServiceImpl implements ISysFileService {
|
||||
* @return 访问地址
|
||||
*/
|
||||
@Override
|
||||
public FileSaveResult uploadFile(MultipartFile file) throws Exception {
|
||||
public FileResult uploadFile(MultipartFile file) throws Exception {
|
||||
// InputStream inputStream = file.getInputStream();
|
||||
// StorePath storePath = storageClient.uploadFile(inputStream, file.getSize(),
|
||||
// FileTypeUtils.getExtension(file), null);
|
||||
// IoUtils.closeQuietly(inputStream);
|
||||
// return domain + "/" + storePath.getFullPath();
|
||||
return FileSaveResult.fail("Not implemented yet!");
|
||||
return FileResult.fail("Not implemented yet!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileResult deleteFiles(String[] fileIds) throws Exception {
|
||||
return FileResult.fail("Not implemented yet!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface ISysFileCRUDService {
|
||||
* @param fileIds 需要删除的文件存储记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSysFileByFileIds(String[] fileIds);
|
||||
int deleteSysFileByFileIds(String[] fileIds) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除文件存储记录信息
|
||||
@@ -57,5 +57,5 @@ public interface ISysFileCRUDService {
|
||||
* @param fileId 文件存储记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSysFileByFileId(String fileId);
|
||||
int deleteSysFileByFileId(String fileId) throws Exception;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
package com.ruoyi.file.service;
|
||||
|
||||
import com.ruoyi.file.domain.FileSaveResult;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import com.ruoyi.file.domain.SysFile;
|
||||
import com.ruoyi.file.mapper.SysFileDynamicSqlSupport;
|
||||
import com.ruoyi.file.mapper.SysFileMapper;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
@@ -15,6 +23,26 @@ public interface ISysFileService {
|
||||
* @param file 上传的文件
|
||||
* @return 保存结果
|
||||
*/
|
||||
FileSaveResult uploadFile(MultipartFile file) throws Exception;
|
||||
FileResult uploadFile(MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param fileIds 文件id
|
||||
*/
|
||||
FileResult deleteFiles(String[] fileIds) throws Exception;
|
||||
|
||||
default List<SysFile> selectFilesById(SysFileMapper sysFileMapper, String[] fileIds) {
|
||||
if (fileIds == null || fileIds.length == 0) {
|
||||
throw new IllegalArgumentException("file ids is empty");
|
||||
}
|
||||
SelectStatementProvider provider = SqlBuilder.select(SysFileMapper.selectList)
|
||||
.from(SysFileDynamicSqlSupport.sysFile)
|
||||
.where(SysFileDynamicSqlSupport.fileId, SqlBuilder.isIn(fileIds))
|
||||
.orderBy(SysFileDynamicSqlSupport.fileId)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return sysFileMapper.selectMany(provider);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.ruoyi.file.service;
|
||||
|
||||
import com.ruoyi.common.core.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.file.constants.FileStorageType;
|
||||
import com.ruoyi.file.domain.FileSaveResult;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import com.ruoyi.file.domain.FileUploadResult;
|
||||
import com.ruoyi.file.domain.SysFile;
|
||||
import com.ruoyi.file.mapper.SysFileMapper;
|
||||
@@ -13,6 +15,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 本地文件存储
|
||||
*
|
||||
@@ -50,19 +56,55 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public FileSaveResult uploadFile(MultipartFile file) throws Exception {
|
||||
public FileResult uploadFile(MultipartFile file) throws Exception {
|
||||
// 保存文件到本地
|
||||
FileUploadResult uploadResult = FileUploadUtils.upload(localFilePath, file);
|
||||
String savedPathFileName = uploadResult.getSavedPathFileName();
|
||||
String requestUrl = domain + localFilePrefix + savedPathFileName;
|
||||
// 保存文件记录
|
||||
SysFile record = getSysFile(uploadResult, requestUrl);
|
||||
SysFile record = buildRecord(uploadResult, requestUrl);
|
||||
sysFileMapper.insertSelective(record);
|
||||
// 返回访问地址
|
||||
return FileSaveResult.success(requestUrl, uploadResult);
|
||||
return FileResult.success(requestUrl, uploadResult);
|
||||
}
|
||||
|
||||
private SysFile getSysFile(FileUploadResult uploadResult, String requestUrl) {
|
||||
/**
|
||||
* 本地文件删除
|
||||
*
|
||||
* @param fileIds 文件id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public FileResult deleteFiles(String[] fileIds) {
|
||||
// 查询文件记录
|
||||
List<SysFile> fileList = selectFilesById(sysFileMapper, fileIds);
|
||||
// 删除文件
|
||||
List<String> warningList = new ArrayList<>();
|
||||
for (SysFile sysFile : fileList) {
|
||||
File file = new File(sysFile.getFilePath());
|
||||
if (file.exists()) {
|
||||
if (file.delete()) {
|
||||
sysFileMapper.deleteByPrimaryKey(sysFile.getFileId());
|
||||
} else {
|
||||
throw new ServiceException("Delete file failed: [" + sysFile.getFilePath() + "]", HttpStatus.ERROR);
|
||||
}
|
||||
} else {
|
||||
warningList.add(sysFile.getFilePath());
|
||||
}
|
||||
}
|
||||
// 组装返回结果
|
||||
FileResult result = FileResult.success();
|
||||
if (!warningList.isEmpty()) {
|
||||
result.setMessage("Files not exists: " + warningList);
|
||||
} else {
|
||||
result.setMessage("Delete file success");
|
||||
}
|
||||
result.setCount(fileList.size() - warningList.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
private SysFile buildRecord(FileUploadResult uploadResult, String requestUrl) {
|
||||
SysFile record = new SysFile();
|
||||
record.setFileId(uploadResult.getFileId()); // 文件ID
|
||||
record.setSavedName(uploadResult.getSavedFileName()); // 保存的文件名
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.ruoyi.file.service;
|
||||
|
||||
import com.alibaba.nacos.common.utils.IoUtils;
|
||||
import com.ruoyi.file.domain.FileSaveResult;
|
||||
import com.ruoyi.file.utils.FileUploadUtils;
|
||||
import com.ruoyi.file.config.MinioConfig;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* TODO 未完成,还需要改造:保存文件记录
|
||||
* Minio 文件存储
|
||||
@@ -33,18 +28,24 @@ public class MinioSysFileServiceImpl implements ISysFileService {
|
||||
* @return 访问地址
|
||||
*/
|
||||
@Override
|
||||
public FileSaveResult uploadFile(MultipartFile file) throws Exception {
|
||||
String fileName = FileUploadUtils.extractFilename(file, null);
|
||||
InputStream inputStream = file.getInputStream();
|
||||
PutObjectArgs args = PutObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
.object(fileName)
|
||||
.stream(inputStream, file.getSize(), -1)
|
||||
.contentType(file.getContentType())
|
||||
.build();
|
||||
client.putObject(args);
|
||||
IoUtils.closeQuietly(inputStream);
|
||||
String requestUrl = minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
|
||||
return FileSaveResult.success(requestUrl, null);
|
||||
public FileResult uploadFile(MultipartFile file) throws Exception {
|
||||
// String fileName = FileUploadUtils.extractFilename(file, null);
|
||||
// InputStream inputStream = file.getInputStream();
|
||||
// PutObjectArgs args = PutObjectArgs.builder()
|
||||
// .bucket(minioConfig.getBucketName())
|
||||
// .object(fileName)
|
||||
// .stream(inputStream, file.getSize(), -1)
|
||||
// .contentType(file.getContentType())
|
||||
// .build();
|
||||
// client.putObject(args);
|
||||
// IoUtils.closeQuietly(inputStream);
|
||||
// String requestUrl = minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
|
||||
// return FileResult.success(requestUrl, null);
|
||||
return FileResult.fail("Not implemented yet!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileResult deleteFiles(String[] fileIds) throws Exception {
|
||||
return FileResult.fail("Not implemented yet!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ruoyi.file.service;
|
||||
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.file.domain.FileResult;
|
||||
import com.ruoyi.file.domain.SysFile;
|
||||
import com.ruoyi.file.mapper.SysFileDynamicSqlSupport;
|
||||
import com.ruoyi.file.mapper.SysFileMapper;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
@@ -24,9 +24,13 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class SysFileCRUDServiceImpl implements ISysFileCRUDService {
|
||||
|
||||
@Autowired
|
||||
private SysFileMapper sysFileMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysFileService sysFileService;
|
||||
|
||||
/**
|
||||
* 查询文件存储记录
|
||||
*
|
||||
@@ -52,13 +56,15 @@ public class SysFileCRUDServiceImpl implements ISysFileCRUDService {
|
||||
SelectStatementProvider provider = SqlBuilder.select(SysFileMapper.selectList)
|
||||
.from(SysFileDynamicSqlSupport.sysFile)
|
||||
.where(SysFileDynamicSqlSupport.fileId, SqlBuilder.isEqualToWhenPresent(sysFile.getFileId()))
|
||||
.and(SysFileDynamicSqlSupport.savedName, SqlBuilder.isLikeWhenPresent(sysFile.getSavedName() == null ? null : "%" + sysFile.getSavedName() + "%"))
|
||||
.and(SysFileDynamicSqlSupport.originalName, SqlBuilder.isLikeWhenPresent(sysFile.getSavedName() == null ? null : "%" + sysFile.getSavedName() + "%"))
|
||||
.and(SysFileDynamicSqlSupport.extension, SqlBuilder.isEqualToWhenPresent(sysFile.getExtension()))
|
||||
.orderBy(SysFileDynamicSqlSupport.createTime.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return sysFileMapper.selectMany(provider);
|
||||
} else {
|
||||
//全部查询
|
||||
return sysFileMapper.select(SelectDSLCompleter.allRows());
|
||||
return sysFileMapper.select(SelectDSLCompleter.allRowsOrderedBy(SysFileDynamicSqlSupport.createTime.descending()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,12 +100,9 @@ public class SysFileCRUDServiceImpl implements ISysFileCRUDService {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteSysFileByFileIds(String[] fileIds) {
|
||||
DeleteStatementProvider provider = SqlBuilder.deleteFrom(SysFileDynamicSqlSupport.sysFile)
|
||||
.where(SysFileDynamicSqlSupport.fileId, SqlBuilder.isIn(fileIds))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return sysFileMapper.delete(provider);
|
||||
public int deleteSysFileByFileIds(String[] fileIds) throws Exception {
|
||||
FileResult result = sysFileService.deleteFiles(fileIds);
|
||||
return result.getCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +113,8 @@ public class SysFileCRUDServiceImpl implements ISysFileCRUDService {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteSysFileByFileId(String fileId) {
|
||||
return sysFileMapper.deleteByPrimaryKey(fileId);
|
||||
public int deleteSysFileByFileId(String fileId) throws Exception {
|
||||
String[] fileIds = {fileId};
|
||||
return deleteSysFileByFileIds(fileIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
.orderBy(${ClassName}DynamicSqlSupport.${pkColumn.javaField})
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return ${className}Mapper.selectMany(provider);
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange" show-overflow-tooltip="true">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
|
||||
<el-table-column type="selection" width="30" align="center" />
|
||||
#foreach($column in $columns)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
@@ -377,7 +377,7 @@ const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
|
||||
@@ -76,12 +76,6 @@
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Services -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
||||
@@ -70,12 +70,6 @@
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 共通业务 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
||||
@@ -70,7 +70,17 @@ public class ItemInfoController extends BaseController {
|
||||
@Log(title = "物品基础信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ItemInfo itemInfo) {
|
||||
return toAjax(itemInfoService.insertItemInfo(itemInfo));
|
||||
return itemInfoService.insertItemInfo(itemInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物品基础信息(带图片文件一起提交)
|
||||
*/
|
||||
@RequiresPermissions("wms:ItemInfo:add")
|
||||
@Log(title = "物品基础信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addWithImage")
|
||||
public AjaxResult addWithImage(ItemInfo itemInfo) {
|
||||
return itemInfoService.insertItemInfo(itemInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +90,17 @@ public class ItemInfoController extends BaseController {
|
||||
@Log(title = "物品基础信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ItemInfo itemInfo) {
|
||||
return toAjax(itemInfoService.updateItemInfo(itemInfo));
|
||||
return itemInfoService.updateItemInfo(itemInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物品基础信息(带图片文件一起提交)
|
||||
*/
|
||||
@RequiresPermissions("wms:ItemInfo:edit")
|
||||
@Log(title = "物品基础信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/editWithImage")
|
||||
public AjaxResult editWithImage(ItemInfo itemInfo) {
|
||||
return itemInfoService.updateItemInfo(itemInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.ruoyi.wms.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -11,681 +16,297 @@ import java.math.BigDecimal;
|
||||
*
|
||||
* <ul>
|
||||
* <li> Table: WMS_M_ITEM_INFO </li>
|
||||
* <li> Remarks: 物品基础信息表 </li>
|
||||
* </ul>
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-20
|
||||
*/
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ItemInfo extends ExtBaseEntity implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//==================== ↓↓↓↓↓↓ 非表字段 ↓↓↓↓↓↓ ====================
|
||||
|
||||
/**
|
||||
* 物品代码
|
||||
* (非表字段)
|
||||
* 物品类型名称
|
||||
*/
|
||||
private String itemTypeName;
|
||||
|
||||
/**
|
||||
* (非表字段)
|
||||
* 标准单位名称
|
||||
*/
|
||||
private String stdUnitName;
|
||||
|
||||
/**
|
||||
* (非表字段)
|
||||
* 包装单位名称
|
||||
*/
|
||||
private String pkgUnitName;
|
||||
|
||||
/**
|
||||
* (非表字段)
|
||||
* 图片文件
|
||||
*/
|
||||
private MultipartFile[] itemImages;
|
||||
|
||||
//==================== ↓↓↓↓↓↓ 扩展方法 ↓↓↓↓↓↓ ====================
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isEnabled() {
|
||||
return enableFlg != null && enableFlg == 1;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isLotNoManaged() {
|
||||
return lotNoMgmtCls != null && lotNoMgmtCls == 1;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public MultipartFile getItemImageFirst() {
|
||||
return itemImages != null && itemImages.length > 0 ? itemImages[0] : null;
|
||||
}
|
||||
|
||||
//==================== ↓↓↓↓↓↓ 表字段 ↓↓↓↓↓↓ ====================
|
||||
|
||||
/**
|
||||
* 物品代码
|
||||
*/
|
||||
private String itemCd;
|
||||
|
||||
/**
|
||||
* 从属部门ID
|
||||
* 从属部门ID
|
||||
*/
|
||||
private Integer deptId;
|
||||
|
||||
/**
|
||||
* 物品名称
|
||||
* 物品名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 筹备提前期
|
||||
* 筹备提前期
|
||||
*/
|
||||
private BigDecimal prepLeadTime;
|
||||
|
||||
/**
|
||||
* 入库提前期
|
||||
* 入库提前期
|
||||
*/
|
||||
private BigDecimal instockLeadTime;
|
||||
|
||||
/**
|
||||
* 放置期
|
||||
* 放置期
|
||||
*/
|
||||
private BigDecimal restingPeriod;
|
||||
|
||||
/**
|
||||
* 出库提前期
|
||||
* 出库提前期
|
||||
*/
|
||||
private BigDecimal outstockLeadTime;
|
||||
|
||||
/**
|
||||
* 规格1
|
||||
* 规格1
|
||||
*/
|
||||
private String spec1;
|
||||
|
||||
/**
|
||||
* 规格2
|
||||
* 规格2
|
||||
*/
|
||||
private String spec2;
|
||||
|
||||
/**
|
||||
* 规格3
|
||||
* 规格3
|
||||
*/
|
||||
private String spec3;
|
||||
|
||||
/**
|
||||
* 规格4
|
||||
* 规格4
|
||||
*/
|
||||
private String spec4;
|
||||
|
||||
/**
|
||||
* 规格5
|
||||
* 规格5
|
||||
*/
|
||||
private String spec5;
|
||||
|
||||
/**
|
||||
* 分类1
|
||||
* 分类1
|
||||
*/
|
||||
private String cls1;
|
||||
|
||||
/**
|
||||
* 分类2
|
||||
* 分类2
|
||||
*/
|
||||
private String cls2;
|
||||
|
||||
/**
|
||||
* 分类3
|
||||
* 分类3
|
||||
*/
|
||||
private String cls3;
|
||||
|
||||
/**
|
||||
* 分类4
|
||||
* 分类4
|
||||
*/
|
||||
private String cls4;
|
||||
|
||||
/**
|
||||
* 分类5
|
||||
* 分类5
|
||||
*/
|
||||
private String cls5;
|
||||
|
||||
/**
|
||||
* 备注1
|
||||
* 备注1
|
||||
*/
|
||||
private String remark1;
|
||||
|
||||
/**
|
||||
* 备注2
|
||||
* 备注2
|
||||
*/
|
||||
private String remark2;
|
||||
|
||||
/**
|
||||
* 备注3
|
||||
* 备注3
|
||||
*/
|
||||
private String remark3;
|
||||
|
||||
/**
|
||||
* 备注4
|
||||
* 备注4
|
||||
*/
|
||||
private String remark4;
|
||||
|
||||
/**
|
||||
* 备注5
|
||||
* 备注5
|
||||
*/
|
||||
private String remark5;
|
||||
|
||||
/**
|
||||
* 供货周期
|
||||
* 供货周期
|
||||
*/
|
||||
private String deliveryPeriod;
|
||||
|
||||
/**
|
||||
* 默认库位号
|
||||
* 默认库位号
|
||||
*/
|
||||
private String defaultStgBinCd;
|
||||
|
||||
/**
|
||||
* 启用标志
|
||||
* 启用标志
|
||||
*/
|
||||
private Integer enableFlg;
|
||||
|
||||
/**
|
||||
* 安全库存量
|
||||
* 安全库存量
|
||||
*/
|
||||
private BigDecimal safetyStock;
|
||||
|
||||
/**
|
||||
* 最大库存量
|
||||
* 最大库存量
|
||||
*/
|
||||
private BigDecimal maxInvQty;
|
||||
|
||||
/**
|
||||
* 发起购买的阈值
|
||||
* 发起购买的阈值
|
||||
*/
|
||||
private BigDecimal purchLimitQty;
|
||||
|
||||
/**
|
||||
* 物品区分
|
||||
* 物品区分
|
||||
*/
|
||||
private String goodsCls;
|
||||
|
||||
/**
|
||||
* 批号管理区分(0:不管理, 1:管理)
|
||||
* 批号管理区分(0:不管理, 1:管理)
|
||||
*/
|
||||
private Integer lotNoMgmtCls;
|
||||
|
||||
/**
|
||||
* 物品类型代码
|
||||
* 物品类型代码
|
||||
*/
|
||||
private String itemTypeCd;
|
||||
|
||||
/**
|
||||
* 标准单位代码
|
||||
* 标准单位代码
|
||||
*/
|
||||
private String stdUnitCd;
|
||||
|
||||
/**
|
||||
* 包装单位代码
|
||||
* 包装单位代码
|
||||
*/
|
||||
private String pkgUnitCd;
|
||||
|
||||
/**
|
||||
* 出库申请最小数量
|
||||
* 出库申请最小数量
|
||||
*/
|
||||
private BigDecimal outstockReqMinQty;
|
||||
|
||||
/**
|
||||
* 出库单位区分
|
||||
* 出库单位区分
|
||||
*/
|
||||
private String outstockUnitCls;
|
||||
|
||||
/**
|
||||
* 单位净重
|
||||
* 单位净重
|
||||
*/
|
||||
private BigDecimal netWeightPerUnit;
|
||||
|
||||
/**
|
||||
* 自身体积(M3)
|
||||
* 自身体积(M3)
|
||||
*/
|
||||
private BigDecimal ownVolM3;
|
||||
|
||||
/**
|
||||
* 尺寸(长)
|
||||
* 尺寸(长)
|
||||
*/
|
||||
private BigDecimal sizeD;
|
||||
|
||||
/**
|
||||
* 尺寸(宽)
|
||||
* 尺寸(宽)
|
||||
*/
|
||||
private BigDecimal sizeW;
|
||||
|
||||
/**
|
||||
* 尺寸(高)
|
||||
* 尺寸(高)
|
||||
*/
|
||||
private BigDecimal sizeH;
|
||||
|
||||
/**
|
||||
* 包装要求描述
|
||||
* 包装要求描述
|
||||
*/
|
||||
private String pkgRqmtDesc;
|
||||
|
||||
/**
|
||||
* 码放要求描述
|
||||
* 码放要求描述
|
||||
*/
|
||||
private String stackingRqmtDesc;
|
||||
|
||||
/**
|
||||
* 储存要求描述
|
||||
* 储存要求描述
|
||||
*/
|
||||
private String stgRqmtDesc;
|
||||
|
||||
/**
|
||||
* 生产商
|
||||
* 生产商
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 图片ID
|
||||
* 图片ID
|
||||
*/
|
||||
private String pictureId;
|
||||
|
||||
/**
|
||||
* 图片URL
|
||||
* 图片URL
|
||||
*/
|
||||
private String pictureUrl;
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getItemCd() {
|
||||
return itemCd;
|
||||
}
|
||||
|
||||
public void setItemCd(String itemCd) {
|
||||
this.itemCd = itemCd == null ? null : itemCd.trim();
|
||||
}
|
||||
|
||||
public Integer getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Integer deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName == null ? null : itemName.trim();
|
||||
}
|
||||
|
||||
public String getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier) {
|
||||
this.supplier = supplier == null ? null : supplier.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getPrepLeadTime() {
|
||||
return prepLeadTime;
|
||||
}
|
||||
|
||||
public void setPrepLeadTime(BigDecimal prepLeadTime) {
|
||||
this.prepLeadTime = prepLeadTime;
|
||||
}
|
||||
|
||||
public BigDecimal getInstockLeadTime() {
|
||||
return instockLeadTime;
|
||||
}
|
||||
|
||||
public void setInstockLeadTime(BigDecimal instockLeadTime) {
|
||||
this.instockLeadTime = instockLeadTime;
|
||||
}
|
||||
|
||||
public BigDecimal getRestingPeriod() {
|
||||
return restingPeriod;
|
||||
}
|
||||
|
||||
public void setRestingPeriod(BigDecimal restingPeriod) {
|
||||
this.restingPeriod = restingPeriod;
|
||||
}
|
||||
|
||||
public BigDecimal getOutstockLeadTime() {
|
||||
return outstockLeadTime;
|
||||
}
|
||||
|
||||
public void setOutstockLeadTime(BigDecimal outstockLeadTime) {
|
||||
this.outstockLeadTime = outstockLeadTime;
|
||||
}
|
||||
|
||||
public String getSpec1() {
|
||||
return spec1;
|
||||
}
|
||||
|
||||
public void setSpec1(String spec1) {
|
||||
this.spec1 = spec1 == null ? null : spec1.trim();
|
||||
}
|
||||
|
||||
public String getSpec2() {
|
||||
return spec2;
|
||||
}
|
||||
|
||||
public void setSpec2(String spec2) {
|
||||
this.spec2 = spec2 == null ? null : spec2.trim();
|
||||
}
|
||||
|
||||
public String getSpec3() {
|
||||
return spec3;
|
||||
}
|
||||
|
||||
public void setSpec3(String spec3) {
|
||||
this.spec3 = spec3 == null ? null : spec3.trim();
|
||||
}
|
||||
|
||||
public String getSpec4() {
|
||||
return spec4;
|
||||
}
|
||||
|
||||
public void setSpec4(String spec4) {
|
||||
this.spec4 = spec4 == null ? null : spec4.trim();
|
||||
}
|
||||
|
||||
public String getSpec5() {
|
||||
return spec5;
|
||||
}
|
||||
|
||||
public void setSpec5(String spec5) {
|
||||
this.spec5 = spec5 == null ? null : spec5.trim();
|
||||
}
|
||||
|
||||
public String getCls1() {
|
||||
return cls1;
|
||||
}
|
||||
|
||||
public void setCls1(String cls1) {
|
||||
this.cls1 = cls1 == null ? null : cls1.trim();
|
||||
}
|
||||
|
||||
public String getCls2() {
|
||||
return cls2;
|
||||
}
|
||||
|
||||
public void setCls2(String cls2) {
|
||||
this.cls2 = cls2 == null ? null : cls2.trim();
|
||||
}
|
||||
|
||||
public String getCls3() {
|
||||
return cls3;
|
||||
}
|
||||
|
||||
public void setCls3(String cls3) {
|
||||
this.cls3 = cls3 == null ? null : cls3.trim();
|
||||
}
|
||||
|
||||
public String getCls4() {
|
||||
return cls4;
|
||||
}
|
||||
|
||||
public void setCls4(String cls4) {
|
||||
this.cls4 = cls4 == null ? null : cls4.trim();
|
||||
}
|
||||
|
||||
public String getCls5() {
|
||||
return cls5;
|
||||
}
|
||||
|
||||
public void setCls5(String cls5) {
|
||||
this.cls5 = cls5 == null ? null : cls5.trim();
|
||||
}
|
||||
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
}
|
||||
|
||||
public void setRemark1(String remark1) {
|
||||
this.remark1 = remark1 == null ? null : remark1.trim();
|
||||
}
|
||||
|
||||
public String getRemark2() {
|
||||
return remark2;
|
||||
}
|
||||
|
||||
public void setRemark2(String remark2) {
|
||||
this.remark2 = remark2 == null ? null : remark2.trim();
|
||||
}
|
||||
|
||||
public String getRemark3() {
|
||||
return remark3;
|
||||
}
|
||||
|
||||
public void setRemark3(String remark3) {
|
||||
this.remark3 = remark3 == null ? null : remark3.trim();
|
||||
}
|
||||
|
||||
public String getRemark4() {
|
||||
return remark4;
|
||||
}
|
||||
|
||||
public void setRemark4(String remark4) {
|
||||
this.remark4 = remark4 == null ? null : remark4.trim();
|
||||
}
|
||||
|
||||
public String getRemark5() {
|
||||
return remark5;
|
||||
}
|
||||
|
||||
public void setRemark5(String remark5) {
|
||||
this.remark5 = remark5 == null ? null : remark5.trim();
|
||||
}
|
||||
|
||||
public String getDeliveryPeriod() {
|
||||
return deliveryPeriod;
|
||||
}
|
||||
|
||||
public void setDeliveryPeriod(String deliveryPeriod) {
|
||||
this.deliveryPeriod = deliveryPeriod == null ? null : deliveryPeriod.trim();
|
||||
}
|
||||
|
||||
public String getDefaultStgBinCd() {
|
||||
return defaultStgBinCd;
|
||||
}
|
||||
|
||||
public void setDefaultStgBinCd(String defaultStgBinCd) {
|
||||
this.defaultStgBinCd = defaultStgBinCd == null ? null : defaultStgBinCd.trim();
|
||||
}
|
||||
|
||||
public Integer getEnableFlg() {
|
||||
return enableFlg;
|
||||
}
|
||||
|
||||
public void setEnableFlg(Integer enableFlg) {
|
||||
this.enableFlg = enableFlg;
|
||||
}
|
||||
|
||||
public BigDecimal getSafetyStock() {
|
||||
return safetyStock;
|
||||
}
|
||||
|
||||
public void setSafetyStock(BigDecimal safetyStock) {
|
||||
this.safetyStock = safetyStock;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxInvQty() {
|
||||
return maxInvQty;
|
||||
}
|
||||
|
||||
public void setMaxInvQty(BigDecimal maxInvQty) {
|
||||
this.maxInvQty = maxInvQty;
|
||||
}
|
||||
|
||||
public BigDecimal getPurchLimitQty() {
|
||||
return purchLimitQty;
|
||||
}
|
||||
|
||||
public void setPurchLimitQty(BigDecimal purchLimitQty) {
|
||||
this.purchLimitQty = purchLimitQty;
|
||||
}
|
||||
|
||||
public String getGoodsCls() {
|
||||
return goodsCls;
|
||||
}
|
||||
|
||||
public void setGoodsCls(String goodsCls) {
|
||||
this.goodsCls = goodsCls == null ? null : goodsCls.trim();
|
||||
}
|
||||
|
||||
public Integer getLotNoMgmtCls() {
|
||||
return lotNoMgmtCls;
|
||||
}
|
||||
|
||||
public void setLotNoMgmtCls(Integer lotNoMgmtCls) {
|
||||
this.lotNoMgmtCls = lotNoMgmtCls;
|
||||
}
|
||||
|
||||
public String getItemTypeCd() {
|
||||
return itemTypeCd;
|
||||
}
|
||||
|
||||
public void setItemTypeCd(String itemTypeCd) {
|
||||
this.itemTypeCd = itemTypeCd == null ? null : itemTypeCd.trim();
|
||||
}
|
||||
|
||||
public String getStdUnitCd() {
|
||||
return stdUnitCd;
|
||||
}
|
||||
|
||||
public void setStdUnitCd(String stdUnitCd) {
|
||||
this.stdUnitCd = stdUnitCd == null ? null : stdUnitCd.trim();
|
||||
}
|
||||
|
||||
public String getPkgUnitCd() {
|
||||
return pkgUnitCd;
|
||||
}
|
||||
|
||||
public void setPkgUnitCd(String pkgUnitCd) {
|
||||
this.pkgUnitCd = pkgUnitCd == null ? null : pkgUnitCd.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getOutstockReqMinQty() {
|
||||
return outstockReqMinQty;
|
||||
}
|
||||
|
||||
public void setOutstockReqMinQty(BigDecimal outstockReqMinQty) {
|
||||
this.outstockReqMinQty = outstockReqMinQty;
|
||||
}
|
||||
|
||||
public String getOutstockUnitCls() {
|
||||
return outstockUnitCls;
|
||||
}
|
||||
|
||||
public void setOutstockUnitCls(String outstockUnitCls) {
|
||||
this.outstockUnitCls = outstockUnitCls == null ? null : outstockUnitCls.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getNetWeightPerUnit() {
|
||||
return netWeightPerUnit;
|
||||
}
|
||||
|
||||
public void setNetWeightPerUnit(BigDecimal netWeightPerUnit) {
|
||||
this.netWeightPerUnit = netWeightPerUnit;
|
||||
}
|
||||
|
||||
public BigDecimal getOwnVolM3() {
|
||||
return ownVolM3;
|
||||
}
|
||||
|
||||
public void setOwnVolM3(BigDecimal ownVolM3) {
|
||||
this.ownVolM3 = ownVolM3;
|
||||
}
|
||||
|
||||
public BigDecimal getSizeD() {
|
||||
return sizeD;
|
||||
}
|
||||
|
||||
public void setSizeD(BigDecimal sizeD) {
|
||||
this.sizeD = sizeD;
|
||||
}
|
||||
|
||||
public BigDecimal getSizeW() {
|
||||
return sizeW;
|
||||
}
|
||||
|
||||
public void setSizeW(BigDecimal sizeW) {
|
||||
this.sizeW = sizeW;
|
||||
}
|
||||
|
||||
public BigDecimal getSizeH() {
|
||||
return sizeH;
|
||||
}
|
||||
|
||||
public void setSizeH(BigDecimal sizeH) {
|
||||
this.sizeH = sizeH;
|
||||
}
|
||||
|
||||
public String getPkgRqmtDesc() {
|
||||
return pkgRqmtDesc;
|
||||
}
|
||||
|
||||
public void setPkgRqmtDesc(String pkgRqmtDesc) {
|
||||
this.pkgRqmtDesc = pkgRqmtDesc == null ? null : pkgRqmtDesc.trim();
|
||||
}
|
||||
|
||||
public String getStackingRqmtDesc() {
|
||||
return stackingRqmtDesc;
|
||||
}
|
||||
|
||||
public void setStackingRqmtDesc(String stackingRqmtDesc) {
|
||||
this.stackingRqmtDesc = stackingRqmtDesc == null ? null : stackingRqmtDesc.trim();
|
||||
}
|
||||
|
||||
public String getStgRqmtDesc() {
|
||||
return stgRqmtDesc;
|
||||
}
|
||||
|
||||
public void setStgRqmtDesc(String stgRqmtDesc) {
|
||||
this.stgRqmtDesc = stgRqmtDesc == null ? null : stgRqmtDesc.trim();
|
||||
}
|
||||
|
||||
public String getManufacturer() {
|
||||
return manufacturer;
|
||||
}
|
||||
|
||||
public void setManufacturer(String manufacturer) {
|
||||
this.manufacturer = manufacturer == null ? null : manufacturer.trim();
|
||||
}
|
||||
|
||||
public String getPictureId() {
|
||||
return pictureId;
|
||||
}
|
||||
|
||||
public void setPictureId(String pictureId) {
|
||||
this.pictureId = pictureId == null ? null : pictureId.trim();
|
||||
}
|
||||
|
||||
public String getPictureUrl() {
|
||||
return pictureUrl;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl) {
|
||||
this.pictureUrl = pictureUrl == null ? null : pictureUrl.trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", itemCd=").append(itemCd);
|
||||
sb.append(", deptId=").append(deptId);
|
||||
sb.append(", itemName=").append(itemName);
|
||||
sb.append(", supplier=").append(supplier);
|
||||
sb.append(", prepLeadTime=").append(prepLeadTime);
|
||||
sb.append(", instockLeadTime=").append(instockLeadTime);
|
||||
sb.append(", restingPeriod=").append(restingPeriod);
|
||||
sb.append(", outstockLeadTime=").append(outstockLeadTime);
|
||||
sb.append(", spec1=").append(spec1);
|
||||
sb.append(", spec2=").append(spec2);
|
||||
sb.append(", spec3=").append(spec3);
|
||||
sb.append(", spec4=").append(spec4);
|
||||
sb.append(", spec5=").append(spec5);
|
||||
sb.append(", cls1=").append(cls1);
|
||||
sb.append(", cls2=").append(cls2);
|
||||
sb.append(", cls3=").append(cls3);
|
||||
sb.append(", cls4=").append(cls4);
|
||||
sb.append(", cls5=").append(cls5);
|
||||
sb.append(", remark1=").append(remark1);
|
||||
sb.append(", remark2=").append(remark2);
|
||||
sb.append(", remark3=").append(remark3);
|
||||
sb.append(", remark4=").append(remark4);
|
||||
sb.append(", remark5=").append(remark5);
|
||||
sb.append(", deliveryPeriod=").append(deliveryPeriod);
|
||||
sb.append(", defaultStgBinCd=").append(defaultStgBinCd);
|
||||
sb.append(", enableFlg=").append(enableFlg);
|
||||
sb.append(", safetyStock=").append(safetyStock);
|
||||
sb.append(", maxInvQty=").append(maxInvQty);
|
||||
sb.append(", purchLimitQty=").append(purchLimitQty);
|
||||
sb.append(", goodsCls=").append(goodsCls);
|
||||
sb.append(", lotNoMgmtCls=").append(lotNoMgmtCls);
|
||||
sb.append(", itemTypeCd=").append(itemTypeCd);
|
||||
sb.append(", stdUnitCd=").append(stdUnitCd);
|
||||
sb.append(", pkgUnitCd=").append(pkgUnitCd);
|
||||
sb.append(", outstockReqMinQty=").append(outstockReqMinQty);
|
||||
sb.append(", outstockUnitCls=").append(outstockUnitCls);
|
||||
sb.append(", netWeightPerUnit=").append(netWeightPerUnit);
|
||||
sb.append(", ownVolM3=").append(ownVolM3);
|
||||
sb.append(", sizeD=").append(sizeD);
|
||||
sb.append(", sizeW=").append(sizeW);
|
||||
sb.append(", sizeH=").append(sizeH);
|
||||
sb.append(", pkgRqmtDesc=").append(pkgRqmtDesc);
|
||||
sb.append(", stackingRqmtDesc=").append(stackingRqmtDesc);
|
||||
sb.append(", stgRqmtDesc=").append(stgRqmtDesc);
|
||||
sb.append(", manufacturer=").append(manufacturer);
|
||||
sb.append(", pictureId=").append(pictureId);
|
||||
sb.append(", pictureUrl=").append(pictureUrl);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.wms.mapper;
|
||||
|
||||
import com.ruoyi.wms.domain.ItemInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物品基础信息扩展Mapper
|
||||
*
|
||||
* @author Alan Scipio
|
||||
* created on 2024/2/21
|
||||
*/
|
||||
public interface ItemInfoExtMapper {
|
||||
|
||||
/**
|
||||
* 页面查询
|
||||
*/
|
||||
List<ItemInfo> selectPageList(ItemInfo itemInfo);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wms.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.wms.domain.ItemInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -33,7 +34,7 @@ public interface IItemInfoService {
|
||||
* @param itemInfo 物品基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
int insertItemInfo(ItemInfo itemInfo);
|
||||
AjaxResult insertItemInfo(ItemInfo itemInfo);
|
||||
|
||||
/**
|
||||
* 修改物品基础信息
|
||||
@@ -41,7 +42,7 @@ public interface IItemInfoService {
|
||||
* @param itemInfo 物品基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updateItemInfo(ItemInfo itemInfo);
|
||||
AjaxResult updateItemInfo(ItemInfo itemInfo);
|
||||
|
||||
/**
|
||||
* 批量删除物品基础信息
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
package com.ruoyi.wms.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.system.api.RemoteFileService;
|
||||
import com.ruoyi.system.api.domain.SysFileInfo;
|
||||
import com.ruoyi.wms.domain.ItemInfo;
|
||||
import com.ruoyi.wms.mapper.ItemInfoDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.ItemInfoExtMapper;
|
||||
import com.ruoyi.wms.mapper.ItemInfoMapper;
|
||||
import com.ruoyi.wms.service.IItemInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -26,8 +32,12 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class ItemInfoServiceImpl implements IItemInfoService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private ItemInfoMapper itemInfoMapper;
|
||||
@Resource
|
||||
private ItemInfoExtMapper itemInfoExtMapper;
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
* 查询物品基础信息
|
||||
@@ -49,38 +59,45 @@ public class ItemInfoServiceImpl implements IItemInfoService {
|
||||
*/
|
||||
@Override
|
||||
public List<ItemInfo> selectItemInfoList(ItemInfo itemInfo) {
|
||||
SelectStatementProvider provider = SqlBuilder.select(ItemInfoMapper.selectList)
|
||||
.from(ItemInfoDynamicSqlSupport.itemInfo)
|
||||
.where(ItemInfoDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(ItemInfoDynamicSqlSupport.itemCd, SqlBuilder.isEqualToWhenPresent(itemInfo.getItemCd()))
|
||||
.and(ItemInfoDynamicSqlSupport.itemName, SqlBuilder.isLikeWhenPresent(itemInfo.getItemName() == null ? null : "%" + itemInfo.getItemName() + "%"))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return itemInfoMapper.selectMany(provider);
|
||||
return itemInfoExtMapper.selectPageList(itemInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物品基础信息
|
||||
*
|
||||
* @param itemInfo 物品基础信息
|
||||
* @param item 物品基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertItemInfo(ItemInfo itemInfo) {
|
||||
return itemInfoMapper.insertSelective(itemInfo);
|
||||
public AjaxResult insertItemInfo(ItemInfo item) {
|
||||
//上传图片文件
|
||||
String uploadErrMsg = uploadItemImage(item);
|
||||
if (StringUtils.isNotBlank(uploadErrMsg)) {
|
||||
return AjaxResult.error(uploadErrMsg);
|
||||
}
|
||||
//存DB
|
||||
int affectedRows = itemInfoMapper.insertSelective(item);
|
||||
return affectedRows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物品基础信息
|
||||
*
|
||||
* @param itemInfo 物品基础信息
|
||||
* @param item 物品基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateItemInfo(ItemInfo itemInfo) {
|
||||
return itemInfoMapper.updateByPrimaryKeySelective(itemInfo);
|
||||
public AjaxResult updateItemInfo(ItemInfo item) {
|
||||
//上传图片文件
|
||||
String uploadErrMsg = uploadItemImage(item);
|
||||
if (StringUtils.isNotBlank(uploadErrMsg)) {
|
||||
return AjaxResult.error(uploadErrMsg);
|
||||
}
|
||||
//存DB
|
||||
int affectedRows = itemInfoMapper.updateByPrimaryKeySelective(item);
|
||||
return affectedRows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,4 +135,31 @@ public class ItemInfoServiceImpl implements IItemInfoService {
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
return itemInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片文件
|
||||
*
|
||||
* @return 错误消息,成功返回null
|
||||
*/
|
||||
private String uploadItemImage(ItemInfo item) {
|
||||
if (item.getItemImages() == null){
|
||||
return null;
|
||||
}
|
||||
for (MultipartFile file : item.getItemImages()) {
|
||||
R<SysFileInfo> fileResult = remoteFileService.upload(file);
|
||||
if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData())) {
|
||||
//上传失败
|
||||
if (fileResult == null || StringUtils.isBlank(fileResult.getMsg())) {
|
||||
return "文件服务异常,请联系管理员";
|
||||
} else {
|
||||
return "文件服务异常," + fileResult.getMsg();
|
||||
}
|
||||
} else {
|
||||
//上传成功
|
||||
item.setPictureId(fileResult.getData().getFileId());
|
||||
item.setPictureUrl(fileResult.getData().getUrl());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ public class ItemTypeServiceImpl implements IItemTypeService {
|
||||
.where(ItemTypeDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(ItemTypeDynamicSqlSupport.itemTypeName, SqlBuilder.isLikeWhenPresent(itemType.getItemTypeName() == null ? null : "%" + itemType.getItemTypeName() + "%"))
|
||||
.and(ItemTypeDynamicSqlSupport.remark1, SqlBuilder.isEqualToWhenPresent(itemType.getRemark1()))
|
||||
.orderBy(ItemTypeDynamicSqlSupport.itemTypeCd)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return itemTypeMapper.selectMany(provider);
|
||||
|
||||
@@ -59,6 +59,7 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
.where(UnitInfoDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(UnitInfoDynamicSqlSupport.unitCode, SqlBuilder.isEqualToWhenPresent(unitInfo.getUnitCode()))
|
||||
.and(UnitInfoDynamicSqlSupport.unitName, SqlBuilder.isLikeWhenPresent(unitInfo.getUnitName()))
|
||||
.orderBy(UnitInfoDynamicSqlSupport.unitCode)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return unitInfoMapper.selectMany(provider);
|
||||
|
||||
@@ -59,6 +59,7 @@ public class WarehouseInfoServiceImpl implements IWarehouseInfoService {
|
||||
.where(WarehouseInfoDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(WarehouseInfoDynamicSqlSupport.whsCd, SqlBuilder.isEqualToWhenPresent(warehouseInfo.getWhsCd()))
|
||||
.and(WarehouseInfoDynamicSqlSupport.whsName, SqlBuilder.isLikeWhenPresent(warehouseInfo.getWhsName() == null ? null : "%" + warehouseInfo.getWhsName() + "%"))
|
||||
.orderBy(WarehouseInfoDynamicSqlSupport.whsCd)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return warehouseInfoMapper.selectMany(provider);
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?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.wms.mapper.ItemInfoExtMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wms.domain.ItemInfo" id="ItemInfoResult">
|
||||
<result property="deptId" column="DEPT_ID"/>
|
||||
<result property="itemCd" column="ITEM_CD"/>
|
||||
<result property="itemName" column="ITEM_NAME"/>
|
||||
<result property="supplier" column="SUPPLIER"/>
|
||||
<result property="prepLeadTime" column="PREP_LEAD_TIME"/>
|
||||
<result property="instockLeadTime" column="INSTOCK_LEAD_TIME"/>
|
||||
<result property="restingPeriod" column="RESTING_PERIOD"/>
|
||||
<result property="outstockLeadTime" column="OUTSTOCK_LEAD_TIME"/>
|
||||
<result property="spec1" column="SPEC_1"/>
|
||||
<result property="spec2" column="SPEC_2"/>
|
||||
<result property="spec3" column="SPEC_3"/>
|
||||
<result property="spec4" column="SPEC_4"/>
|
||||
<result property="spec5" column="SPEC_5"/>
|
||||
<result property="cls1" column="CLS_1"/>
|
||||
<result property="cls2" column="CLS_2"/>
|
||||
<result property="cls3" column="CLS_3"/>
|
||||
<result property="cls4" column="CLS_4"/>
|
||||
<result property="cls5" column="CLS_5"/>
|
||||
<result property="deliveryPeriod" column="DELIVERY_PERIOD"/>
|
||||
<result property="defaultStgBinCd" column="DEFAULT_STG_BIN_CD"/>
|
||||
<result property="enableFlg" column="ENABLE_FLG"/>
|
||||
<result property="safetyStock" column="SAFETY_STOCK"/>
|
||||
<result property="maxInvQty" column="MAX_INV_QTY"/>
|
||||
<result property="purchLimitQty" column="PURCH_LIMIT_QTY"/>
|
||||
<result property="goodsCls" column="GOODS_CLS"/>
|
||||
<result property="lotNoMgmtCls" column="LOT_NO_MGMT_CLS"/>
|
||||
<result property="itemTypeCd" column="ITEM_TYPE_CD"/>
|
||||
<result property="stdUnitCd" column="STD_UNIT_CD"/>
|
||||
<result property="pkgUnitCd" column="PKG_UNIT_CD"/>
|
||||
<result property="outstockReqMinQty" column="OUTSTOCK_REQ_MIN_QTY"/>
|
||||
<result property="outstockUnitCls" column="OUTSTOCK_UNIT_CLS"/>
|
||||
<result property="netWeightPerUnit" column="NET_WEIGHT_PER_UNIT"/>
|
||||
<result property="ownVolM3" column="OWN_VOL_M3"/>
|
||||
<result property="sizeD" column="SIZE_D"/>
|
||||
<result property="sizeW" column="SIZE_W"/>
|
||||
<result property="sizeH" column="SIZE_H"/>
|
||||
<result property="pkgRqmtDesc" column="PKG_RQMT_DESC"/>
|
||||
<result property="stackingRqmtDesc" column="STACKING_RQMT_DESC"/>
|
||||
<result property="stgRqmtDesc" column="STG_RQMT_DESC"/>
|
||||
<result property="manufacturer" column="MANUFACTURER"/>
|
||||
<result property="pictureId" column="PICTURE_ID"/>
|
||||
<result property="pictureUrl" column="PICTURE_URL"/>
|
||||
<result property="updateCount" column="UPDATE_COUNT"/>
|
||||
<result property="deleteFlag" column="DELETE_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="remark" column="remark"/>
|
||||
<result property="remark1" column="REMARK_1"/>
|
||||
<result property="remark2" column="REMARK_2"/>
|
||||
<result property="remark3" column="REMARK_3"/>
|
||||
<result property="remark4" column="REMARK_4"/>
|
||||
<result property="remark5" column="REMARK_5"/>
|
||||
<result property="itemTypeName" column="ITEM_TYPE_NAME"/>
|
||||
<result property="stdUnitName" column="stdUnitName"/>
|
||||
<result property="pkgUnitName" column="pkgUnitName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPageList" parameterType="com.ruoyi.wms.domain.ItemInfo" resultMap="ItemInfoResult">
|
||||
select
|
||||
t1.DEPT_ID,
|
||||
t1.ITEM_CD,
|
||||
t1.ITEM_NAME,
|
||||
t1.SUPPLIER,
|
||||
t1.PREP_LEAD_TIME,
|
||||
t1.INSTOCK_LEAD_TIME,
|
||||
t1.RESTING_PERIOD,
|
||||
t1.OUTSTOCK_LEAD_TIME,
|
||||
t1.SPEC_1,
|
||||
t1.SPEC_2,
|
||||
t1.SPEC_3,
|
||||
t1.SPEC_4,
|
||||
t1.SPEC_5,
|
||||
t1.CLS_1,
|
||||
t1.CLS_2,
|
||||
t1.CLS_3,
|
||||
t1.CLS_4,
|
||||
t1.CLS_5,
|
||||
t1.DELIVERY_PERIOD,
|
||||
t1.DEFAULT_STG_BIN_CD,
|
||||
t1.ENABLE_FLG,
|
||||
t1.SAFETY_STOCK,
|
||||
t1.MAX_INV_QTY,
|
||||
t1.PURCH_LIMIT_QTY,
|
||||
t1.GOODS_CLS,
|
||||
t1.LOT_NO_MGMT_CLS,
|
||||
t1.ITEM_TYPE_CD,
|
||||
t1.STD_UNIT_CD,
|
||||
t1.PKG_UNIT_CD,
|
||||
t1.OUTSTOCK_REQ_MIN_QTY,
|
||||
t1.OUTSTOCK_UNIT_CLS,
|
||||
t1.NET_WEIGHT_PER_UNIT,
|
||||
t1.OWN_VOL_M3,
|
||||
t1.SIZE_D,
|
||||
t1.SIZE_W,
|
||||
t1.SIZE_H,
|
||||
t1.PKG_RQMT_DESC,
|
||||
t1.STACKING_RQMT_DESC,
|
||||
t1.STG_RQMT_DESC,
|
||||
t1.MANUFACTURER,
|
||||
t1.PICTURE_ID,
|
||||
t1.PICTURE_URL,
|
||||
t1.UPDATE_COUNT,
|
||||
t1.DELETE_FLAG,
|
||||
t1.create_by,
|
||||
t1.create_time,
|
||||
t1.update_by,
|
||||
t1.update_time,
|
||||
t1.remark,
|
||||
itemType.ITEM_TYPE_NAME,
|
||||
stdUnit.UNIT_NAME as stdUnitName,
|
||||
pkgUnit.UNIT_NAME as pkgUnitName
|
||||
from WMS_M_ITEM_INFO t1
|
||||
left join WMS_M_ITEM_TYPE itemType on t1.ITEM_TYPE_CD = itemType.ITEM_TYPE_CD and itemType.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO stdUnit on t1.STD_UNIT_CD = stdUnit.UNIT_CODE and stdUnit.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO pkgUnit on t1.PKG_UNIT_CD = pkgUnit.UNIT_CODE and pkgUnit.DELETE_FLAG = 0
|
||||
<where>
|
||||
and t1.DELETE_FLAG = 0
|
||||
<if test="itemCd != null and itemCd != ''">
|
||||
and t1.ITEM_CD = #{itemCd}
|
||||
</if>
|
||||
<if test="itemName != null and itemName != ''">
|
||||
and t1.ITEM_NAME like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by t1.ITEM_CD
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user