parent
eae6443f11
commit
e4a49e6b1c
@ -1,50 +0,0 @@
|
|||||||
package com.ruoyi.system.api.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class SysFile
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 文件名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件地址
|
|
||||||
*/
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrl()
|
|
||||||
{
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUrl(String url)
|
|
||||||
{
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("name", getName())
|
|
||||||
.append("url", getUrl())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysFileInfo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件ID
|
||||||
|
*/
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.common.services.constants;
|
package com.ruoyi.file.constants;
|
||||||
|
|
||||||
import com.ruoyi.common.core.constant.IEnum;
|
import com.ruoyi.common.core.constant.IEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.file.controller;
|
||||||
|
|
||||||
|
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.security.annotation.RequiresPermissions;
|
||||||
|
import com.ruoyi.file.domain.SysFile;
|
||||||
|
import com.ruoyi.file.service.ISysFileCRUDService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储记录Controller
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/FileRecord")
|
||||||
|
public class SysFileCRUDController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISysFileCRUDService crudService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文件存储记录列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("file:FileRecord:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysFile sysFile) {
|
||||||
|
startPage();
|
||||||
|
List<SysFile> list = crudService.selectSysFileList(sysFile);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出文件存储记录列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("file:FileRecord:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysFile sysFile) {
|
||||||
|
List<SysFile> list = crudService.selectSysFileList(sysFile);
|
||||||
|
ExcelUtil<SysFile> util = new ExcelUtil<>(SysFile.class);
|
||||||
|
util.exportExcel(response, list, "文件存储记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件存储记录详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("file:FileRecord:query")
|
||||||
|
@GetMapping(value = "/{fileId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("fileId") String fileId) {
|
||||||
|
return success(crudService.selectSysFileByFileId(fileId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.file.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class FileSaveForm implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 域名或本机访问地址
|
||||||
|
*/
|
||||||
|
public String domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储基础目录
|
||||||
|
*/
|
||||||
|
private String localBaseDir;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源映射路径 前缀
|
||||||
|
*/
|
||||||
|
public String localFilePrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传的文件
|
||||||
|
*/
|
||||||
|
private MultipartFile file;
|
||||||
|
|
||||||
|
}
|
@ -1,23 +0,0 @@
|
|||||||
package com.ruoyi.file.domain;
|
|
||||||
|
|
||||||
import com.ruoyi.file.utils.FileUploadResult;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Alan Scipio
|
|
||||||
* created on 2024/2/19
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class FileSaveRecord implements Serializable {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private String requestUrl;
|
|
||||||
|
|
||||||
private FileUploadResult uploadResult;
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.ruoyi.file.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alan Scipio
|
||||||
|
* created on 2024/2/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FileSaveResult implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private boolean success;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件请求地址
|
||||||
|
*/
|
||||||
|
private String requestUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传结果
|
||||||
|
*/
|
||||||
|
private FileUploadResult uploadResult;
|
||||||
|
|
||||||
|
public String getFileId() {
|
||||||
|
return uploadResult == null ? "" : uploadResult.getFileId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FileSaveResult success(String requestUrl, FileUploadResult uploadResult) {
|
||||||
|
FileSaveResult result = new FileSaveResult();
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setRequestUrl(requestUrl);
|
||||||
|
result.setUploadResult(uploadResult);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FileSaveResult fail(String message) {
|
||||||
|
FileSaveResult result = new FileSaveResult();
|
||||||
|
result.setSuccess(false);
|
||||||
|
result.setMessage(message);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.common.services.mapper;
|
package com.ruoyi.file.mapper;
|
||||||
|
|
||||||
import org.mybatis.dynamic.sql.AliasableSqlTable;
|
import org.mybatis.dynamic.sql.AliasableSqlTable;
|
||||||
import org.mybatis.dynamic.sql.SqlColumn;
|
import org.mybatis.dynamic.sql.SqlColumn;
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.file.service;
|
||||||
|
|
||||||
|
import com.ruoyi.file.domain.SysFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储记录Service接口
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-19
|
||||||
|
*/
|
||||||
|
public interface ISysFileCRUDService {
|
||||||
|
/**
|
||||||
|
* 查询文件存储记录
|
||||||
|
*
|
||||||
|
* @param fileId 文件存储记录主键
|
||||||
|
* @return 文件存储记录
|
||||||
|
*/
|
||||||
|
SysFile selectSysFileByFileId(String fileId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文件存储记录列表
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 文件存储记录集合
|
||||||
|
*/
|
||||||
|
List<SysFile> selectSysFileList(SysFile sysFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增文件存储记录
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertSysFile(SysFile sysFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改文件存储记录
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateSysFile(SysFile sysFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除文件存储记录
|
||||||
|
*
|
||||||
|
* @param fileIds 需要删除的文件存储记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysFileByFileIds(String[] fileIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件存储记录信息
|
||||||
|
*
|
||||||
|
* @param fileId 文件存储记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysFileByFileId(String fileId);
|
||||||
|
}
|
@ -0,0 +1,116 @@
|
|||||||
|
package com.ruoyi.file.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
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;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysFileCRUDServiceImpl implements ISysFileCRUDService {
|
||||||
|
@Autowired
|
||||||
|
private SysFileMapper sysFileMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文件存储记录
|
||||||
|
*
|
||||||
|
* @param fileId 文件存储记录主键
|
||||||
|
* @return 文件存储记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysFile selectSysFileByFileId(String fileId) {
|
||||||
|
Optional<SysFile> result = sysFileMapper.selectOne(dsl -> dsl.where(SysFileDynamicSqlSupport.fileId, SqlBuilder.isEqualTo(fileId)));
|
||||||
|
return result.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文件存储记录列表
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 文件存储记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysFile> selectSysFileList(SysFile sysFile) {
|
||||||
|
if (StringUtils.isNotBlank(sysFile.getSavedName()) || StringUtils.isNotBlank(sysFile.getFileId())) {
|
||||||
|
//条件查询
|
||||||
|
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() + "%"))
|
||||||
|
.build()
|
||||||
|
.render(RenderingStrategies.MYBATIS3);
|
||||||
|
return sysFileMapper.selectMany(provider);
|
||||||
|
} else {
|
||||||
|
//全部查询
|
||||||
|
return sysFileMapper.select(SelectDSLCompleter.allRows());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增文件存储记录
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int insertSysFile(SysFile sysFile) {
|
||||||
|
return sysFileMapper.insertSelective(sysFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改文件存储记录
|
||||||
|
*
|
||||||
|
* @param sysFile 文件存储记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int updateSysFile(SysFile sysFile) {
|
||||||
|
return sysFileMapper.updateByPrimaryKeySelective(sysFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除文件存储记录
|
||||||
|
*
|
||||||
|
* @param fileIds 需要删除的文件存储记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件存储记录信息
|
||||||
|
*
|
||||||
|
* @param fileId 文件存储记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int deleteSysFileByFileId(String fileId) {
|
||||||
|
return sysFileMapper.deleteByPrimaryKey(fileId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
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.common.services.domain.SysSeqRule;
|
||||||
|
import com.ruoyi.system.service.ISysSeqRuleService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号生成规则Controller
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/SeqRule")
|
||||||
|
public class SysSeqRuleController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISysSeqRuleService sysSeqRuleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询序列号生成规则列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysSeqRule sysSeqRule) {
|
||||||
|
startPage();
|
||||||
|
List<SysSeqRule> list = sysSeqRuleService.selectSysSeqRuleList(sysSeqRule);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出序列号生成规则列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:export")
|
||||||
|
@Log(title = "序列号生成规则", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysSeqRule sysSeqRule) {
|
||||||
|
List<SysSeqRule> list = sysSeqRuleService.selectSysSeqRuleList(sysSeqRule);
|
||||||
|
ExcelUtil<SysSeqRule> util = new ExcelUtil<>(SysSeqRule.class);
|
||||||
|
util.exportExcel(response, list, "序列号生成规则数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取序列号生成规则详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:query")
|
||||||
|
@GetMapping(value = "/{ruleId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("ruleId") Long ruleId) {
|
||||||
|
return success(sysSeqRuleService.selectSysSeqRuleByRuleId(ruleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增序列号生成规则
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:add")
|
||||||
|
@Log(title = "序列号生成规则", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SysSeqRule sysSeqRule) {
|
||||||
|
return toAjax(sysSeqRuleService.insertSysSeqRule(sysSeqRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改序列号生成规则
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:edit")
|
||||||
|
@Log(title = "序列号生成规则", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SysSeqRule sysSeqRule) {
|
||||||
|
return toAjax(sysSeqRuleService.updateSysSeqRule(sysSeqRule));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除序列号生成规则
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:remove")
|
||||||
|
@Log(title = "序列号生成规则", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ruleIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ruleIds) {
|
||||||
|
return toAjax(sysSeqRuleService.deleteSysSeqRuleByRuleIds(ruleIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则启用状态修改
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:SeqRule:edit")
|
||||||
|
@Log(title = "序列号生成规则启用状态修改", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/changeRuleEnableFlag")
|
||||||
|
public AjaxResult changeRuleEnableFlag(@RequestBody SysSeqRule sysSeqRule) {
|
||||||
|
return toAjax(sysSeqRuleService.updateEnableFlag(sysSeqRule));
|
||||||
|
}
|
||||||
|
}
|
@ -1,76 +1,76 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.system.domain.SysConfig;
|
import com.ruoyi.system.domain.SysConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 数据层
|
* 参数配置 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface SysConfigMapper
|
public interface SysConfigMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置信息
|
* 查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfig(SysConfig config);
|
SysConfig selectConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID查询配置
|
* 通过ID查询配置
|
||||||
*
|
*
|
||||||
* @param configId 参数ID
|
* @param configId 参数ID
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfigById(Long configId);
|
SysConfig selectConfigById(Long configId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置集合
|
* @return 参数配置集合
|
||||||
*/
|
*/
|
||||||
public List<SysConfig> selectConfigList(SysConfig config);
|
List<SysConfig> selectConfigList(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param configKey 参数键名
|
* @param configKey 参数键名
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig checkConfigKeyUnique(String configKey);
|
SysConfig checkConfigKeyUnique(String configKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConfig(SysConfig config);
|
int insertConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateConfig(SysConfig config);
|
int updateConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除参数配置
|
* 删除参数配置
|
||||||
*
|
*
|
||||||
* @param configId 参数ID
|
* @param configId 参数ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteConfigById(Long configId);
|
int deleteConfigById(Long configId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除参数信息
|
* 批量删除参数信息
|
||||||
*
|
*
|
||||||
* @param configIds 需要删除的参数ID
|
* @param configIds 需要删除的参数ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteConfigByIds(Long[] configIds);
|
int deleteConfigByIds(Long[] configIds);
|
||||||
}
|
}
|
@ -1,82 +1,82 @@
|
|||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.system.domain.SysConfig;
|
import com.ruoyi.system.domain.SysConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置 服务层
|
* 参数配置 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface ISysConfigService
|
public interface ISysConfigService {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置信息
|
* 查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param configId 参数配置ID
|
* @param configId 参数配置ID
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfigById(Long configId);
|
SysConfig selectConfigById(Long configId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param configKey 参数键名
|
* @param configKey 参数键名
|
||||||
* @return 参数键值
|
* @return 参数键值
|
||||||
*/
|
*/
|
||||||
public String selectConfigByKey(String configKey);
|
String selectConfigByKey(String configKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置集合
|
* @return 参数配置集合
|
||||||
*/
|
*/
|
||||||
public List<SysConfig> selectConfigList(SysConfig config);
|
List<SysConfig> selectConfigList(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConfig(SysConfig config);
|
int insertConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
*
|
*
|
||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateConfig(SysConfig config);
|
int updateConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除参数信息
|
* 批量删除参数信息
|
||||||
*
|
*
|
||||||
* @param configIds 需要删除的参数ID
|
* @param configIds 需要删除的参数ID
|
||||||
*/
|
*/
|
||||||
public void deleteConfigByIds(Long[] configIds);
|
void deleteConfigByIds(Long[] configIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载参数缓存数据
|
* 加载参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void loadingConfigCache();
|
void loadingConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空参数缓存数据
|
* 清空参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void clearConfigCache();
|
void clearConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置参数缓存数据
|
* 重置参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void resetConfigCache();
|
void resetConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数键名是否唯一
|
* 校验参数键名是否唯一
|
||||||
*
|
*
|
||||||
* @param config 参数信息
|
* @param config 参数信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean checkConfigKeyUnique(SysConfig config);
|
boolean checkConfigKeyUnique(SysConfig config);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqRule;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号生成规则Service接口
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-20
|
||||||
|
*/
|
||||||
|
public interface ISysSeqRuleService {
|
||||||
|
/**
|
||||||
|
* 查询序列号生成规则
|
||||||
|
*
|
||||||
|
* @param ruleId 序列号生成规则主键
|
||||||
|
* @return 序列号生成规则
|
||||||
|
*/
|
||||||
|
SysSeqRule selectSysSeqRuleByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询序列号生成规则列表
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 序列号生成规则集合
|
||||||
|
*/
|
||||||
|
List<SysSeqRule> selectSysSeqRuleList(SysSeqRule sysSeqRule);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增序列号生成规则
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertSysSeqRule(SysSeqRule sysSeqRule);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改序列号生成规则
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateSysSeqRule(SysSeqRule sysSeqRule);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除序列号生成规则
|
||||||
|
*
|
||||||
|
* @param ruleIds 需要删除的序列号生成规则主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysSeqRuleByRuleIds(Long[] ruleIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除序列号生成规则信息
|
||||||
|
*
|
||||||
|
* @param ruleId 序列号生成规则主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteSysSeqRuleByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新序列号生成规则启用状态
|
||||||
|
*
|
||||||
|
* @param rule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateEnableFlag(SysSeqRule rule);
|
||||||
|
}
|
@ -0,0 +1,132 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.services.domain.SysSeqRule;
|
||||||
|
import com.ruoyi.common.services.mapper.SysSeqRuleDynamicSqlSupport;
|
||||||
|
import com.ruoyi.common.services.mapper.SysSeqRuleMapper;
|
||||||
|
import com.ruoyi.system.service.ISysSeqRuleService;
|
||||||
|
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;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号生成规则Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ryas
|
||||||
|
* created on 2024-02-20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysSeqRuleServiceImpl implements ISysSeqRuleService {
|
||||||
|
@Autowired
|
||||||
|
private SysSeqRuleMapper sysSeqRuleMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询序列号生成规则
|
||||||
|
*
|
||||||
|
* @param ruleId 序列号生成规则主键
|
||||||
|
* @return 序列号生成规则
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysSeqRule selectSysSeqRuleByRuleId(Long ruleId) {
|
||||||
|
Optional<SysSeqRule> result = sysSeqRuleMapper.selectOne(dsl -> dsl.where(SysSeqRuleDynamicSqlSupport.ruleId, SqlBuilder.isEqualTo(ruleId)));
|
||||||
|
return result.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询序列号生成规则列表
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 序列号生成规则
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysSeqRule> selectSysSeqRuleList(SysSeqRule sysSeqRule) {
|
||||||
|
if (StringUtils.isNotBlank(sysSeqRule.getRuleName()) || StringUtils.isNotBlank(sysSeqRule.getSeqDistCd())) {
|
||||||
|
//条件查询
|
||||||
|
SelectStatementProvider provider = SqlBuilder.select(SysSeqRuleMapper.selectList)
|
||||||
|
.from(SysSeqRuleDynamicSqlSupport.sysSeqRule)
|
||||||
|
.where(SysSeqRuleDynamicSqlSupport.seqDistCd, SqlBuilder.isEqualToWhenPresent(sysSeqRule.getSeqDistCd()))
|
||||||
|
.and(SysSeqRuleDynamicSqlSupport.ruleName, SqlBuilder.isLikeWhenPresent(sysSeqRule.getRuleName() == null ? null : "%" + sysSeqRule.getRuleName() + "%"))
|
||||||
|
.build()
|
||||||
|
.render(RenderingStrategies.MYBATIS3);
|
||||||
|
return sysSeqRuleMapper.selectMany(provider);
|
||||||
|
} else {
|
||||||
|
//全部查询
|
||||||
|
return sysSeqRuleMapper.select(SelectDSLCompleter.allRows());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增序列号生成规则
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int insertSysSeqRule(SysSeqRule sysSeqRule) {
|
||||||
|
return sysSeqRuleMapper.insertSelective(sysSeqRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改序列号生成规则
|
||||||
|
*
|
||||||
|
* @param sysSeqRule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int updateSysSeqRule(SysSeqRule sysSeqRule) {
|
||||||
|
return sysSeqRuleMapper.updateByPrimaryKeySelective(sysSeqRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除序列号生成规则
|
||||||
|
*
|
||||||
|
* @param ruleIds 需要删除的序列号生成规则主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int deleteSysSeqRuleByRuleIds(Long[] ruleIds) {
|
||||||
|
DeleteStatementProvider provider = SqlBuilder.deleteFrom(SysSeqRuleDynamicSqlSupport.sysSeqRule)
|
||||||
|
.where(SysSeqRuleDynamicSqlSupport.ruleId, SqlBuilder.isIn(ruleIds))
|
||||||
|
.build()
|
||||||
|
.render(RenderingStrategies.MYBATIS3);
|
||||||
|
return sysSeqRuleMapper.delete(provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除序列号生成规则信息
|
||||||
|
*
|
||||||
|
* @param ruleId 序列号生成规则主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int deleteSysSeqRuleByRuleId(Long ruleId) {
|
||||||
|
return sysSeqRuleMapper.deleteByPrimaryKey(ruleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新序列号生成规则启用状态
|
||||||
|
*
|
||||||
|
* @param rule 序列号生成规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public int updateEnableFlag(SysSeqRule rule) {
|
||||||
|
SysSeqRule updateRule = new SysSeqRule();
|
||||||
|
updateRule.setRuleId(rule.getRuleId());
|
||||||
|
updateRule.setEnableFlag(rule.getEnableFlag());
|
||||||
|
return sysSeqRuleMapper.updateByPrimaryKeySelective(updateRule);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询文件存储记录列表
|
||||||
|
export function listFileRecord(query) {
|
||||||
|
return request({
|
||||||
|
url: '/file/FileRecord/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询文件存储记录详细
|
||||||
|
export function getFileRecord(fileId) {
|
||||||
|
return request({
|
||||||
|
url: '/file/FileRecord/' + fileId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询序列号生成规则列表
|
||||||
|
export function listSeqRule(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询序列号生成规则详细
|
||||||
|
export function getSeqRule(ruleId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule/' + ruleId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增序列号生成规则
|
||||||
|
export function addSeqRule(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改序列号生成规则
|
||||||
|
export function updateSeqRule(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除序列号生成规则
|
||||||
|
export function delSeqRule(ruleId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule/' + ruleId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 规则启用状态修改
|
||||||
|
export function changeRuleEnableFlag(ruleId, enableFlag) {
|
||||||
|
const data = {
|
||||||
|
ruleId,
|
||||||
|
enableFlag,
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/system/SeqRule/changeRuleEnableFlag',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="文件ID" prop="fileId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.fileId"
|
||||||
|
placeholder="请输入文件ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原始文件名" prop="originalName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.originalName"
|
||||||
|
placeholder="请输入原始文件名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['file:FileRecord:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="FileRecordList" @selection-change="handleSelectionChange" show-overflow-tooltip="true">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="文件ID" align="center" prop="fileId" />
|
||||||
|
<el-table-column label="保存文件名" align="center" prop="savedName" />
|
||||||
|
<el-table-column label="原始文件名" align="center" prop="originalName" />
|
||||||
|
<el-table-column label="文件路径" align="center" prop="filePath" />
|
||||||
|
<el-table-column label="文件后缀" align="center" prop="extension" />
|
||||||
|
<el-table-column label="存储方式" align="center" prop="storageType" />
|
||||||
|
<el-table-column label="获取文件的URL" align="center" prop="requestUrl" />
|
||||||
|
<el-table-column label="文件大小(Byte)" align="center" prop="fileSize" />
|
||||||
|
<el-table-column label="创建者" align="center" prop="createBy" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="更新者" align="center" prop="updateBy" />
|
||||||
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="FileRecord">
|
||||||
|
import { listFileRecord, getFileRecord } from "@/api/file/FileRecord";
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
|
const FileRecordList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(false);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
fileId: null,
|
||||||
|
savedName: null,
|
||||||
|
originalName: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询文件存储记录列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listFileRecord(queryParams.value).then(response => {
|
||||||
|
FileRecordList.value = response.rows;
|
||||||
|
total.value = response.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
fileId: null,
|
||||||
|
savedName: null,
|
||||||
|
originalName: null,
|
||||||
|
filePath: null,
|
||||||
|
extension: null,
|
||||||
|
storageType: null,
|
||||||
|
requestUrl: null,
|
||||||
|
fileSize: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null
|
||||||
|
};
|
||||||
|
proxy.resetForm("FileRecordRef");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map(item => item.fileId);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
//页面打开时查询
|
||||||
|
//getList();
|
||||||
|
</script>
|
Loading…
Reference in new issue