文件分类标记

This commit is contained in:
liang.chao 2025-09-15 15:43:00 +08:00
parent 7f02158886
commit 0865725147
27 changed files with 1269 additions and 2 deletions

View File

@ -3,10 +3,12 @@ package com.bonus.web.controller.archive;
import com.bonus.common.annotation.RequiresPermissions;
import com.bonus.common.annotation.SysLog;
import com.bonus.common.core.controller.BaseController;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.common.core.domain.R;
import com.bonus.common.core.page.TableDataInfo;
import com.bonus.common.enums.OperaType;
import com.bonus.web.domain.ArchivalCatalogueDto;
import com.bonus.web.domain.SelectDto;
import com.bonus.web.service.ArchiveService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -133,4 +135,17 @@ public class ArchiveController extends BaseController {
}
}
@ApiOperation(value = "档案分类标记下拉")
@GetMapping("getFilesClassifyMarkSelect")
@SysLog(title = "档案分类标记下拉", module = "档案管理->档案分类标记下拉", businessType = OperaType.QUERY, details = "档案分类标记下拉", logType = 1)
public AjaxResult getFilesClassifyMarkSelect(ArchivalCatalogueDto dto) {
try {
List<SelectDto> list = service.getFilesClassifyMarkSelect(dto);
return AjaxResult.success(list);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
}

View File

@ -0,0 +1,71 @@
package com.bonus.web.controller.archive;
import com.bonus.common.annotation.RequiresPermissions;
import com.bonus.common.annotation.SysLog;
import com.bonus.common.core.controller.BaseController;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.common.core.page.TableDataInfo;
import com.bonus.common.enums.OperaType;
import com.bonus.web.domain.ArchivedSettingDto;
import com.bonus.web.service.ArchivedSettingService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 9:54
*/
@RestController
@RequestMapping("/archivedSetting")
@Slf4j
public class ArchivedSettingController extends BaseController {
@Autowired
private ArchivedSettingService service;
@ApiOperation(value = "归档配置")
@GetMapping("detail")
@SysLog(title = "归档配置", module = "数据/档案移交->归档配置", businessType = OperaType.QUERY, details = "归档配置", logType = 1)
@RequiresPermissions("archived:setting:detail")
public AjaxResult getArchivedSetting(ArchivedSettingDto dto) {
try {
List<ArchivedSettingDto> list = service.getArchivedSetting(dto);
return AjaxResult.success(list);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "新增归档配置")
@PostMapping("add")
@SysLog(title = "新增归档配置", module = "数据/档案移交->归档配置", businessType = OperaType.INSERT, details = "新增归档配置", logType = 1)
@RequiresPermissions("archived:setting:add")
public AjaxResult addArchivedSetting(ArchivedSettingDto dto) {
try {
return service.addArchivedSetting(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "修改归档配置")
@PostMapping("edit")
@SysLog(title = "修改归档配置", module = "数据/档案移交->归档配置", businessType = OperaType.UPDATE, details = "修改归档配置", logType = 1)
@RequiresPermissions("archived:setting:edit")
public AjaxResult updateArchivedSetting(ArchivedSettingDto dto) {
try {
return service.updateArchivedSetting(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
}

View File

@ -108,4 +108,22 @@ public class FileManagementController extends BaseController {
return R.fail("请求出错了");
}
}
@ApiOperation(value = "档案移交确认")
@PostMapping("updateIntegrityStatus")
@SysLog(title = "档案移交确认", module = "档案管理->档案目录管理", businessType = OperaType.DELETE, details = "档案移交确认", logType = 1)
@RequiresPermissions("file:manage:confirm")
public R updateIntegrityStatus(@RequestBody DaKyProFilesContentsDto dto) {
try {
Integer i = fileManageService.updateIntegrityStatus(dto);
if (i > 0) {
return R.ok();
} else {
return R.fail("移交失败");
}
} catch (Exception e) {
log.error(e.toString(), e);
return R.fail("请求出错了");
}
}
}

View File

@ -0,0 +1,97 @@
package com.bonus.web.controller.archive;
import com.bonus.common.annotation.RequiresPermissions;
import com.bonus.common.annotation.SysLog;
import com.bonus.common.core.controller.BaseController;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.common.core.page.TableDataInfo;
import com.bonus.common.enums.OperaType;
import com.bonus.web.domain.TransferApplyDto;
import com.bonus.web.service.TransferApplyService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:24
*/
@RestController
@RequestMapping("/transferApply")
@Slf4j
public class TransferApplyController extends BaseController {
@Autowired
private TransferApplyService transferApplyService;
@ApiOperation(value = "档案移交申请列表")
@GetMapping("getTransferApplyList")
@SysLog(title = "档案移交申请列表", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请列表", logType = 1)
@RequiresPermissions("transfer:apply:list")
public TableDataInfo getTransferApplyList(TransferApplyDto dto) {
try {
startPage();
List<TransferApplyDto> list = transferApplyService.list(dto);
return getDataTable(list);
} catch (Exception e) {
log.error(e.toString(), e);
return getDataTable(new ArrayList<>());
}
}
@ApiOperation(value = "新增档案移交申请")
@PostMapping("saveTransferApply")
@SysLog(title = "新增档案移交申请", module = "数据/档案移交->档案移交申请", businessType = OperaType.INSERT, details = "新增档案移交申请", logType = 1)
@RequiresPermissions("transfer:apply:add")
public AjaxResult saveTransferApply(@RequestBody TransferApplyDto dto) {
try {
return transferApplyService.save(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "档案移交申请详情")
@GetMapping("getTransferApply")
@SysLog(title = "档案移交申请详情", module = "数据/档案移交->档案移交申请", businessType = OperaType.QUERY, details = "档案移交申请详情", logType = 1)
@RequiresPermissions("transfer:apply:query")
public AjaxResult getTransferApply(TransferApplyDto dto) {
try {
TransferApplyDto transferApply = transferApplyService.getTransferApply(dto);
return AjaxResult.success(transferApply);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "编辑档案移交申请")
@PostMapping("editTransferApply")
@SysLog(title = "编辑档案移交申请", module = "数据/档案移交->档案移交申请", businessType = OperaType.UPDATE, details = "编辑档案移交申请", logType = 1)
@RequiresPermissions("transfer:apply:edit")
public AjaxResult editTransferApply(@RequestBody TransferApplyDto dto) {
try {
return transferApplyService.edit(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "删除档案移交申请")
@PostMapping("delTransferApply")
@SysLog(title = "删除档案移交申请", module = "数据/档案移交->档案移交申请", businessType = OperaType.UPDATE, details = "删除档案移交申请", logType = 1)
@RequiresPermissions("transfer:apply:del")
public AjaxResult delTransferApply(@RequestBody TransferApplyDto dto) {
try {
return transferApplyService.del(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
}

View File

@ -0,0 +1,132 @@
package com.bonus.web.core.config;
/**
* @Authorliang.chao
* @Date2025/9/15 - 10:43
*/
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class CronExpressionGenerator {
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
public static String generateCron(String archivedType, String cycle, String time, String weekOfDay, String monthDay) {
if (archivedType == null || time == null || time.trim().isEmpty()) {
return null;
}
try {
if ("2".equals(archivedType)) {
// ---- 不定期归档一次性执行 ----
LocalDateTime dateTime = LocalDateTime.parse(time.trim(), DATETIME_FORMATTER);
return String.format("%d %d %d %d %d ? %d",
dateTime.getSecond(),
dateTime.getMinute(),
dateTime.getHour(),
dateTime.getDayOfMonth(),
dateTime.getMonthValue(),
dateTime.getYear()
);
} else if ("1".equals(archivedType)) {
// ---- 定期归档周期性执行 ----
if (cycle == null) return null;
LocalTime localTime = LocalTime.parse(time.trim(), TIME_FORMATTER);
int second = localTime.getSecond();
int minute = localTime.getMinute();
int hour = localTime.getHour();
switch (cycle) {
// 每天
case "1":
return String.format("%d %d %d * * ?", second, minute, hour);
// 每周
case "2":
if (weekOfDay == null || weekOfDay.trim().isEmpty()) return null;
List<String> days = Arrays.stream(weekOfDay.split(","))
.map(String::trim)
.filter(d -> !d.isEmpty())
.map(CronExpressionGenerator::convertWeekDay)
.collect(Collectors.toList());
String joinedDays = joinList(days, ",");
return joinedDays.isEmpty() ? null :
String.format("%d %d %d ? * %s", second, minute, hour, joinedDays);
// 每月
case "3":
if (monthDay == null || monthDay.trim().isEmpty()) return null;
List<String> validDays = Arrays.stream(monthDay.split(","))
.map(String::trim)
.filter(d -> !d.isEmpty())
.filter(CronExpressionGenerator::isValidDayOfMonth)
.collect(Collectors.toList());
String validDayStr = joinList(validDays, ",");
return validDayStr.isEmpty() ? null :
String.format("%d %d %d %s * ?", second, minute, hour, validDayStr);
default:
return null;
}
} else {
return null;
}
} catch (DateTimeParseException e) {
return null; // 格式错误
}
}
private static String convertWeekDay(String dayStr) {
if ("1".equals(dayStr)) return "MON";
if ("2".equals(dayStr)) return "TUE";
if ("3".equals(dayStr)) return "WED";
if ("4".equals(dayStr)) return "THU";
if ("5".equals(dayStr)) return "FRI";
if ("6".equals(dayStr)) return "SAT";
if ("7".equals(dayStr)) return "SUN";
return "";
}
private static boolean isValidDayOfMonth(String dayStr) {
try {
int day = Integer.parseInt(dayStr);
return day >= 1 && day <= 31;
} catch (NumberFormatException e) {
return false;
}
}
private static String joinList(List<String> list, String delimiter) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
sb.append(list.get(i));
if (i < list.size() - 1) {
sb.append(delimiter);
}
}
return sb.toString();
}
// --- 测试 ---
public static void main(String[] args) {
// 定期归档精确到秒
System.out.println("【定期归档】");
System.out.println(generateCron("1", "1", "02:30:15", null, null));
// 输出15 30 2 * * ?
System.out.println(generateCron("1", "2", "03:45:30", "1,5", null));
// 输出30 45 3 ? * MON,FRI
System.out.println(generateCron("1", "3", "01:15:00", null, "1,15"));
// 输出0 15 1 1,15 * ?
// 不定期归档
System.out.println("【不定期归档】");
System.out.println(generateCron("2", null, "2025-09-15 10:30:45", null, null));
// 输出45 30 10 15 9 ? 2025
}
}

View File

@ -0,0 +1,62 @@
package com.bonus.web.domain;
/**
* @Authorliang.chao
* @Date2025/9/15 - 9:51
*/
import lombok.Data;
@Data
public class ArchivedSettingDto {
/**
* id
*/
private Integer id;
/**
* 归档类型 1.定期归档配置 2.不定期归档配置
*/
private String archivedType;
/**
* 周期 1.每天 2.每周 3.每月
*/
private String cycle;
/**
* 时间例如02:00
*/
private String time;
/**
* 一周中的哪一天 1.星期一 2.星期二 ... 7.星期天多个可用逗号分隔
*/
private String weekOfDay;
/**
* 创建时间
*/
private String createTime;
/**
* 修改时间
*/
private String updateTime;
/**
* 是否启用 0.未启用 1.启用
*/
private String useStatus;
/**
* cron表达式
*/
private String cronStr;
/**
* 每月几号 1-31号
*/
private String monthDay;
}

View File

@ -104,6 +104,10 @@ public class DaKyProFilesContentsDto {
* 修改人姓名
*/
private String updateUserName;
/**
* 文件id
*/
private String fileId;
/**
* 文件地址
*/

View File

@ -0,0 +1,117 @@
package com.bonus.web.domain;
import lombok.Data;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:22
*/
@Data
public class TransferApplyDto {
/**
* 主键ID
*/
private Integer id;
/**
* 项目ID
*/
private String proId;
/**
* 工程名称
*/
private String proName;
/**
* 单项工程名称
*/
private String singleProName;
/**
* 接收组织ID
*/
private String deptId;
/**
* 接收组织名称
*/
private String deptName;
/**
* 申请人
*/
private String applyUser;
/**
* 审核人
*/
private String auditUser;
/**
* 申请时间
*/
private String applyTime;
/**
* 审核时间
*/
private String auditTime;
/**
* 审批状态0.待审批 1.审批通过 2.审批驳回
*/
private String auditStatus;
/**
* 审批意见
*/
private String auditOpinion;
/**
* 移交进度0.进行中 1.已完成
*/
private String transferStatus;
/**
* 移交时间第一个档案移交时间格式yyyy-MM-dd
*/
private String transferTime;
/**
* 创建时间
*/
private String createTime;
/**
* 修改时间
*/
private String updateTime;
/**
* 创建人ID
*/
private Integer createUserId;
/**
* 创建人姓名
*/
private String createUserName;
/**
* 修改人姓名
*/
private String updateUserName;
/**
* 修改人ID
*/
private Integer updateUserId;
/**
* 是否删除0.删除 1.未删除
*/
private String delFlag;
private List<TransferFileDto> transferFileDtos;
}

View File

@ -0,0 +1,75 @@
package com.bonus.web.domain;
import lombok.Data;
/**
* @Authorliang.chao
* @Date2025/9/15 - 14:01
*/
@Data
public class TransferFileDto {
/**
* 主键ID
*/
private Integer id;
/**
* 档案移交申请ID外键关联 da_ky_transfer_apply.id
*/
private Integer transferApplyId;
/**
* 项目匹配档案目录ID关联 da_ky_pro_files_contents.id
*/
private String proFilesContentsId;
/**
* 项目ID
*/
private String proId;
/**
* 系统资源文件ID关联 da_ky_sys_file_source.id
*/
private Integer fileSourceId;
/**
* 文件名称
*/
private String fileName;
/**
* 文件路径
*/
private String filePath;
/**
* 移交状态0.未移交 1.已移交
*/
private String transferStatus;
/**
* 移交时间
*/
private String transferTime;
/**
* 接收状态0.未接收 1.已接收
*/
private String receiveStatus;
/**
* 接收时间
*/
private String receiveTime;
/**
* 创建时间
*/
private String createTime;
/**
* 修改时间
*/
private String updateTime;
}

View File

@ -1,6 +1,7 @@
package com.bonus.web.mapper;
import com.bonus.web.domain.ArchivalCatalogueDto;
import com.bonus.web.domain.SelectDto;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -23,5 +24,7 @@ public interface ArchiveMapper {
ArchivalCatalogueDto getArchivalCatalogueById(ArchivalCatalogueDto dto);
Integer getchild(ArchivalCatalogueDto dto);
Integer getchild(ArchivalCatalogueDto dto);
List<SelectDto> getFilesClassifyMarkSelect(ArchivalCatalogueDto dto);
}

View File

@ -0,0 +1,19 @@
package com.bonus.web.mapper;
import com.bonus.web.domain.ArchivedSettingDto;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 9:59
*/
@Mapper
public interface ArchivedSettingMapper {
List<ArchivedSettingDto> getArchivedSetting(ArchivedSettingDto dto);
Integer addArchivedSetting(ArchivedSettingDto dto);
Integer updateArchivedSetting(ArchivedSettingDto dto);
}

View File

@ -28,4 +28,8 @@ public interface FileManageMapper {
Integer delFileManage(DaKyProFilesContentsDto dto);
Integer selectFileManage(DaKyProFilesContentsDto dto);
List<String> getFilesClassifyNameStandard();
Integer updateIntegrityStatus(DaKyProFilesContentsDto dto);
}

View File

@ -23,4 +23,6 @@ public interface ProjectMapper {
Integer insertDakyProFilesContents(DaKyProFilesContentsDto dakyProFilesContentsDto);
List<ArchivalCatalogueDto> getfilesContentsById(ProjectDto projectDto);
Integer updateFileStatus(DaKyProFilesContentsDto dto);
}

View File

@ -0,0 +1,29 @@
package com.bonus.web.mapper;
import com.bonus.web.domain.TransferApplyDto;
import com.bonus.web.domain.TransferFileDto;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:27
*/
@Mapper
public interface TransferApplyMapper {
public List<TransferApplyDto> list(TransferApplyDto dto);
public Integer insert(TransferApplyDto dto);
Integer insertTransferFile(TransferFileDto transferFileDto);
TransferApplyDto getTransferApply(TransferApplyDto dto);
List<TransferFileDto> getTransferFile(TransferApplyDto dto);
Integer edit(TransferApplyDto dto);
Integer delTransferFiles(TransferApplyDto dto);
Integer del(TransferApplyDto dto);
}

View File

@ -1,6 +1,7 @@
package com.bonus.web.service;
import com.bonus.web.domain.ArchivalCatalogueDto;
import com.bonus.web.domain.SelectDto;
import java.util.List;
@ -20,4 +21,6 @@ public interface ArchiveService {
Integer delArchivalCatalogue(ArchivalCatalogueDto dto);
ArchivalCatalogueDto getArchivalCatalogueById(ArchivalCatalogueDto dto);
List<SelectDto> getFilesClassifyMarkSelect(ArchivalCatalogueDto dto);
}

View File

@ -0,0 +1,18 @@
package com.bonus.web.service;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.ArchivedSettingDto;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 9:58
*/
public interface ArchivedSettingService {
List<ArchivedSettingDto> getArchivedSetting(ArchivedSettingDto dto);
AjaxResult addArchivedSetting(ArchivedSettingDto dto);
AjaxResult updateArchivedSetting(ArchivedSettingDto dto);
}

View File

@ -19,4 +19,6 @@ public interface FileManageService {
R updateFileManage(DaKyProFilesContentsDto dto);
Integer delFileManage(DaKyProFilesContentsDto dto);
Integer updateIntegrityStatus(DaKyProFilesContentsDto dto);
}

View File

@ -0,0 +1,22 @@
package com.bonus.web.service;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.TransferApplyDto;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:26
*/
public interface TransferApplyService {
List<TransferApplyDto> list(TransferApplyDto dto);
AjaxResult save(TransferApplyDto dto);
TransferApplyDto getTransferApply(TransferApplyDto dto);
AjaxResult edit(TransferApplyDto dto);
AjaxResult del(TransferApplyDto dto);
}

View File

@ -3,6 +3,7 @@ package com.bonus.web.service.impl;
import com.bonus.common.utils.SecurityUtils;
import com.bonus.web.controller.tool.TreeBuilder;
import com.bonus.web.domain.ArchivalCatalogueDto;
import com.bonus.web.domain.SelectDto;
import com.bonus.web.mapper.ArchiveMapper;
import com.bonus.web.service.ArchiveService;
import org.springframework.stereotype.Service;
@ -61,4 +62,9 @@ public class ArchiveServiceImpl implements ArchiveService {
public ArchivalCatalogueDto getArchivalCatalogueById(ArchivalCatalogueDto dto) {
return archiveMapper.getArchivalCatalogueById(dto);
}
@Override
public List<SelectDto> getFilesClassifyMarkSelect(ArchivalCatalogueDto dto) {
return archiveMapper.getFilesClassifyMarkSelect(dto);
}
}

View File

@ -0,0 +1,61 @@
package com.bonus.web.service.impl;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.core.config.CronExpressionGenerator;
import com.bonus.web.domain.ArchivedSettingDto;
import com.bonus.web.mapper.ArchivedSettingMapper;
import com.bonus.web.service.ArchivedSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Authorliang.chao
* @Date2025/9/15 - 9:58
*/
@Service
public class ArchivedSettingServiceImpl implements ArchivedSettingService {
@Autowired
private ArchivedSettingMapper archivedSettingMapper;
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@Override
public List<ArchivedSettingDto> getArchivedSetting(ArchivedSettingDto dto) {
return archivedSettingMapper.getArchivedSetting(dto);
}
@Override
public AjaxResult addArchivedSetting(ArchivedSettingDto dto) {
String cronStr = CronExpressionGenerator.generateCron(dto.getArchivedType(), dto.getCycle(), dto.getTime(), dto.getWeekOfDay(), dto.getMonthDay());
dto.setCronStr(cronStr);
Integer i = archivedSettingMapper.addArchivedSetting(dto);
if (i > 0) {
return AjaxResult.success("配置成功");
} else {
return AjaxResult.error("配置失败");
}
}
@Override
public AjaxResult updateArchivedSetting(ArchivedSettingDto dto) {
String cronStr = CronExpressionGenerator.generateCron(dto.getArchivedType(), dto.getCycle(), dto.getTime(), dto.getWeekOfDay(), dto.getMonthDay());
dto.setCronStr(cronStr);
Integer i = archivedSettingMapper.updateArchivedSetting(dto);
if (i > 0) {
return AjaxResult.success("修改成功");
} else {
return AjaxResult.error("修改失败");
}
}
}

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.domain.R;
import com.bonus.web.controller.tool.TreeBuilder;
import com.bonus.web.domain.DaKyProFilesContentsDto;
import com.bonus.web.mapper.FileManageMapper;
import com.bonus.web.mapper.ProjectMapper;
import com.bonus.web.service.FileManageService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,6 +23,9 @@ public class FileManageServiceImpl implements FileManageService {
@Autowired
private FileManageMapper fileManageMapper;
@Autowired
private ProjectMapper projectMapper;
@Override
public List<DaKyProFilesContentsDto> list(DaKyProFilesContentsDto daKyProFilesContentsDto) {
List<DaKyProFilesContentsDto> list = fileManageMapper.list(daKyProFilesContentsDto);
@ -45,6 +49,13 @@ public class FileManageServiceImpl implements FileManageService {
return R.fail("档案名称重复");
}
if (StringUtils.isNotBlank(dto.getFilePath())) {
// 判断是否包含文件命名规范
List<String> list = fileManageMapper.getFilesClassifyNameStandard();
for (String s : list) {
if (!dto.getFilePath().contains(s)) {
return R.fail("文件命名不符合规范");
}
}
fileManageMapper.saveFileSource(dto);
}
return R.ok(fileManageMapper.saveFileManage(dto));
@ -70,4 +81,10 @@ public class FileManageServiceImpl implements FileManageService {
fileManageMapper.delFileSource(dto);
return fileManageMapper.delFileManage(dto);
}
@Override
public Integer updateIntegrityStatus(DaKyProFilesContentsDto dto) {
fileManageMapper.updateIntegrityStatus(dto);
return projectMapper.updateFileStatus(dto);
}
}

View File

@ -0,0 +1,86 @@
package com.bonus.web.service.impl;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.TransferApplyDto;
import com.bonus.web.domain.TransferFileDto;
import com.bonus.web.mapper.TransferApplyMapper;
import com.bonus.web.service.TransferApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import static com.bonus.common.utils.SecurityUtils.getLoginUser;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:27
*/
@Service
public class TransferApplyServiceImpl implements TransferApplyService {
@Autowired
private TransferApplyMapper transferApplyMapper;
@Override
public List<TransferApplyDto> list(TransferApplyDto dto) {
return transferApplyMapper.list(dto);
}
@Override
public AjaxResult save(TransferApplyDto dto) {
try {
dto.setAuditStatus("0");
dto.setCreateUserId(getLoginUser().getUserId().intValue());
dto.setCreateUserName(getLoginUser().getUsername());
dto.setUpdateUserId(getLoginUser().getUserId().intValue());
dto.setUpdateUserName(getLoginUser().getUsername());
Integer i = transferApplyMapper.insert(dto);
List<TransferFileDto> transferFileDtos = dto.getTransferFileDtos();
for (TransferFileDto transferFileDto : transferFileDtos) {
transferFileDto.setTransferApplyId(dto.getId());
transferApplyMapper.insertTransferFile(transferFileDto);
}
return i > 0 ? AjaxResult.success("保存成功") : AjaxResult.error("保存失败");
} catch (Exception e) {
return AjaxResult.error("接口异常");
}
}
@Override
public TransferApplyDto getTransferApply(TransferApplyDto dto) {
TransferApplyDto transferApply = transferApplyMapper.getTransferApply(dto);
transferApply.setTransferFileDtos(transferApplyMapper.getTransferFile(dto));
return transferApply;
}
@Override
public AjaxResult edit(TransferApplyDto dto) {
try {
dto.setAuditStatus("0");
dto.setUpdateUserId(getLoginUser().getUserId().intValue());
dto.setUpdateUserName(getLoginUser().getUsername());
transferApplyMapper.edit(dto);
// 先删后增
Integer i = transferApplyMapper.delTransferFiles(dto);
List<TransferFileDto> transferFileDtos = dto.getTransferFileDtos();
for (TransferFileDto transferFileDto : transferFileDtos) {
transferFileDto.setTransferApplyId(dto.getId());
transferApplyMapper.insertTransferFile(transferFileDto);
}
return i > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
} catch (Exception e) {
return AjaxResult.error("接口异常");
}
}
@Override
public AjaxResult del(TransferApplyDto dto) {
Integer i = transferApplyMapper.delTransferFiles(dto);
if (i > 0) {
Integer i1 = transferApplyMapper.del(dto);
return i1 > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
} else {
return AjaxResult.error("档案删除失败");
}
}
}

View File

@ -151,5 +151,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
t2.id = #{id} and t1.del_flag = '1'
</select>
<select id="getFilesClassifyMarkSelect" resultType="com.bonus.web.domain.SelectDto">
SELECT
id,
classify_mark_name AS name
FROM
da_ky_files_classify_mark
WHERE
del_flag = '1'
</select>
</mapper>

View File

@ -0,0 +1,86 @@
<?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.bonus.web.mapper.ArchivedSettingMapper">
<insert id="addArchivedSetting">
INSERT INTO da_ky_archived_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="archivedType != null and archivedType != ''">
archived_type,
</if>
<if test="cycle != null and cycle != ''">
cycle,
</if>
<if test="time != null and time != ''">
`time`,
</if>
<if test="weekOfDay != null and weekOfDay != ''">
week_of_day,
</if>
<if test="useStatus != null and useStatus != ''">
use_status,
</if>
<if test="cronStr != null and cronStr != ''">
cron_str,
</if>
<if test="monthDay != null and monthDay != ''">
month_day,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="archivedType != null and archivedType != ''">
#{archivedType},
</if>
<if test="cycle != null and cycle != ''">
#{cycle},
</if>
<if test="time != null and time != ''">
#{time},
</if>
<if test="weekOfDay != null and weekOfDay != ''">
#{weekOfDay},
</if>
<if test="useStatus != null and useStatus != ''">
#{useStatus},
</if>
<if test="cronStr != null and cronStr != ''">
#{cronStr},
</if>
<if test="monthDay != null and monthDay != ''">
#{monthDay},
</if>
</trim>
</insert>
<update id="updateArchivedSetting">
UPDATE da_ky_archived_setting
<set>
<if test="archivedType != null and archivedType != ''">
archived_type = #{archivedType},
</if>
<if test="cycle != null and cycle != ''">
cycle = #{cycle},
</if>
<if test="time != null and time != ''">
`time` = #{time},
</if>
<if test="weekOfDay != null and weekOfDay != ''">
week_of_day = #{weekOfDay},
</if>
<if test="useStatus != null and useStatus != ''">
use_status = #{useStatus},
</if>
<if test="cronStr != null and cronStr != ''">
cron_str = #{cronStr},
</if>
<if test="monthDay != null and monthDay != ''">
month_day = #{monthDay},
</if>
</set>
WHERE id = #{id}
</update>
<select id="getArchivedSetting" resultType="com.bonus.web.domain.ArchivedSettingDto">
select * from da_ky_archived_setting
</select>
</mapper>

View File

@ -106,6 +106,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time = now()
WHERE id = #{id}
</update>
<update id="updateIntegrityStatus">
UPDATE da_ky_pro_files_contents
set
integrity_status = '1'
WHERE pro_id = #{proId}
</update>
<delete id="delFileSource">
DELETE FROM da_ky_sys_file_source
WHERE id = #{id}
@ -142,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dkpfc.data_source AS dataSource,
dkpfc.is_unique AS isUnique,
dkpfc.integrity_status AS integrityStatus,
dkfs.id AS fileId,
dkfs.create_time AS createTime,
dkfs.source_file_name AS sourceFileName,
dkfs.create_user_name AS createUserName
@ -167,4 +174,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and id != #{id}
</if>
</select>
<select id="getFilesClassifyNameStandard" resultType="java.lang.String">
SELECT
dkfcns.standard_name
FROM
da_ky_files_classify_name_standard dkfcns
WHERE
dkfcns.del_flag = '1' and standard_type = '1'
</select>
</mapper>

View File

@ -53,8 +53,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
id = #{proId}
</update>
<update id="updateFileStatus">
UPDATE da_ky_project
SET
file_status = '1'
WHERE
id = #{proId}
</update>
<select id="list" resultType="com.bonus.web.domain.ProjectDto">
<select id="list" resultType="com.bonus.web.domain.ProjectDto">
SELECT
dkp.*,
dksdd.dict_label proTypeName,

View File

@ -0,0 +1,287 @@
<?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.bonus.web.mapper.TransferApplyMapper">
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
INSERT INTO da_ky_transfer_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="proId != null and proId != ''">
pro_id,
</if>
<if test="proName != null and proName != ''">
pro_name,
</if>
<if test="singleProName != null and singleProName != ''">
single_pro_name,
</if>
<if test="deptId != null and deptId != ''">
dept_id,
</if>
<if test="deptName != null and deptName != ''">
dept_name,
</if>
<if test="applyUser != null and applyUser != ''">
apply_user,
</if>
<if test="applyTime != null">
apply_time,
</if>
<if test="auditStatus != null and auditStatus != ''">
audit_status,
</if>
<if test="auditOpinion != null and auditOpinion != ''">
audit_opinion,
</if>
<if test="transferStatus != null and transferStatus != ''">
transfer_status,
</if>
<if test="transferTime != null and transferTime != ''">
transfer_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="createUserName != null and createUserName != ''">
create_user_name,
</if>
<if test="updateUserName != null and updateUserName != ''">
update_user_name,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="proId != null and proId != ''">
#{proId},
</if>
<if test="proName != null and proName != ''">
#{proName},
</if>
<if test="singleProName != null and singleProName != ''">
#{singleProName},
</if>
<if test="deptId != null and deptId != ''">
#{deptId},
</if>
<if test="deptName != null and deptName != ''">
#{deptName},
</if>
<if test="applyUser != null and applyUser != ''">
#{applyUser},
</if>
<if test="applyTime != null">
#{applyTime},
</if>
<if test="auditStatus != null and auditStatus != ''">
#{auditStatus},
</if>
<if test="auditOpinion != null and auditOpinion != ''">
#{auditOpinion},
</if>
<if test="transferStatus != null and transferStatus != ''">
#{transferStatus},
</if>
<if test="transferTime != null and transferTime != ''">
#{transferTime},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="createUserName != null and createUserName != ''">
#{createUserName},
</if>
<if test="updateUserName != null and updateUserName != ''">
#{updateUserName},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
</trim>
</insert>
<insert id="insertTransferFile">
INSERT INTO da_ky_transfer_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="transferApplyId != null">
transfer_apply_id,
</if>
<if test="proFilesContentsId != null and proFilesContentsId != ''">
pro_files_contents_id,
</if>
<if test="proId != null and proId != ''">
pro_id,
</if>
<if test="fileSourceId != null">
file_source_id,
</if>
<if test="fileName != null and fileName != ''">
file_name,
</if>
<if test="filePath != null and filePath != ''">
file_path,
</if>
<if test="transferStatus != null and transferStatus != ''">
transfer_status,
</if>
<if test="transferTime != null">
transfer_time,
</if>
<if test="receiveStatus != null and receiveStatus != ''">
receive_status,
</if>
<if test="receiveTime != null">
receive_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="transferApplyId != null">
#{transferApplyId},
</if>
<if test="proFilesContentsId != null and proFilesContentsId != ''">
#{proFilesContentsId},
</if>
<if test="proId != null and proId != ''">
#{proId},
</if>
<if test="fileSourceId != null">
#{fileSourceId},
</if>
<if test="fileName != null and fileName != ''">
#{fileName},
</if>
<if test="filePath != null and filePath != ''">
#{filePath},
</if>
<if test="transferStatus != null and transferStatus != ''">
#{transferStatus},
</if>
<if test="transferTime != null">
#{transferTime},
</if>
<if test="receiveStatus != null and receiveStatus != ''">
#{receiveStatus},
</if>
<if test="receiveTime != null">
#{receiveTime},
</if>
</trim>
</insert>
<update id="edit">
UPDATE da_ky_transfer_apply
<set>
<if test="proId != null and proId != ''">
pro_id = #{proId},
</if>
<if test="proName != null and proName != ''">
pro_name = #{proName},
</if>
<if test="singleProName != null and singleProName != ''">
single_pro_name = #{singleProName},
</if>
<if test="deptId != null and deptId != ''">
dept_id = #{deptId},
</if>
<if test="deptName != null and deptName != ''">
dept_name = #{deptName},
</if>
<if test="applyUser != null and applyUser != ''">
apply_user = #{applyUser},
</if>
<if test="applyTime != null">
apply_time = #{applyTime},
</if>
<if test="auditStatus != null and auditStatus != ''">
audit_status = #{auditStatus},
</if>
<if test="auditOpinion != null and auditOpinion != ''">
audit_opinion = #{auditOpinion},
</if>
<if test="transferStatus != null and transferStatus != ''">
transfer_status = #{transferStatus},
</if>
<if test="transferTime != null and transferTime != ''">
transfer_time = #{transferTime},
</if>
<if test="updateUserName != null and updateUserName != ''">
update_user_name = #{updateUserName},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
WHERE id = #{id}
</update>
<delete id="delTransferFiles">
DELETE FROM da_ky_transfer_file
WHERE transfer_apply_id = #{id}
</delete>
<delete id="del">
DELETE FROM da_ky_transfer_apply
WHERE id = #{id}
</delete>
<select id="list" resultType="com.bonus.web.domain.TransferApplyDto">
SELECT
id,
pro_id AS proId,
pro_name AS proName,
single_pro_name AS singleProName,
dept_id AS deptId,
dept_name AS deptName,
apply_user AS applyUser,
apply_time AS applyTime,
audit_status AS auditStatus,
audit_opinion AS auditOpinion,
transfer_status AS transferStatus,
transfer_time AS transferTime,
create_time AS createTime,
update_time AS updateTime,
create_user_id AS createUserId,
create_user_name AS createUserName,
update_user_name AS updateUserName,
update_user_id AS updateUserId,
del_flag AS delFlag
FROM da_ky_transfer_apply
where del_flag = '1'
<if test="proId != null and proId != ''">
and pro_id = #{proId}
</if>
ORDER BY create_time DESC
</select>
<select id="getTransferApply" resultType="com.bonus.web.domain.TransferApplyDto">
SELECT
dept_name AS deptName,
pro_name AS proName,
apply_user AS applyUser,
apply_time AS applyTime,
audit_user AS auditUser,
audit_time AS auditTime,
audit_opinion AS auditOpinion,
case audit_status when '0' then '待审批'
when '1' then '审批通过'
when '2' then '审批驳回'
else '' end AS auditStatus
FROM da_ky_transfer_apply
where del_flag = '1' and id = #{id}
</select>
<select id="getTransferFile" resultType="com.bonus.web.domain.TransferFileDto">
SELECT
dkp.pro_name AS proName,
dkp.single_pro_name AS singleProName,
dktf.file_name AS fileName
FROM da_ky_transfer_file dktf
left join da_ky_project dkp on dkp.id = dktf.pro_id
where dktf.transfer_apply_id = #{id}
</select>
</mapper>