business/src/main/java/com/ycl/domain/entity/File.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/resources/mapper/ProjectProcessMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
system/src/main/java/com/ycl/system/domain/base/AbsEntity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
business/src/main/java/com/ycl/domain/entity/File.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ycl.common.enums.business.FileTypeEnum; import com.ycl.system.domain.base.AbsEntity; import lombok.Data; @@ -22,8 +23,6 @@ private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.ASSIGN_ID) private Integer id; /** * 文件路径 */ @@ -35,7 +34,7 @@ /** * 文件分类 */ private String type; private FileTypeEnum type; /** * 文件名 */ business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.common.base.Result; import com.ycl.common.enums.business.FileTypeEnum; import com.ycl.domain.entity.File; import com.ycl.domain.entity.ProjectInfo; import com.ycl.domain.form.ProjectInfoForm; @@ -10,6 +11,7 @@ import com.ycl.domain.vo.*; import com.ycl.framework.utils.PageUtil; import com.ycl.mapper.ProjectInfoMapper; import com.ycl.service.FileService; import com.ycl.service.ProjectInfoService; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -34,7 +36,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, ProjectInfo> implements ProjectInfoService { private final ProjectInfoMapper projectInfoMapper; private final FileService fileService; /** * 添加 * @@ -46,10 +48,14 @@ public Result add(ProjectInfoForm form) { //添加基本信息 ProjectInfo entity = ProjectInfoForm.getEntityByForm(form, null); // baseMapper.insert(entity); baseMapper.insert(entity); //添加文件 List<File> fileList = form.getFileList(); fileList.forEach(item->{ item.setBusId(entity.getId()); item.setType(FileTypeEnum.PROJECT_INFO); }); fileService.saveBatch(fileList); return Result.ok("添加成功"); } business/src/main/resources/mapper/ProjectProcessMapper.xml
@@ -14,9 +14,9 @@ <result column="invest_type" property="investType" /> <result column="project_phase" property="projectPhase" /> <result column="tag" property="tag" /> <result column="competent_department" property="competentDepartment" /> <!-- <result column="competent_department" property="competentDepartment" />--> <result column="area_code" property="areaCode" /> <result column="management_centralization" property="managementCentralization" /> <!-- <result column="management_centralization" property="managementCentralization" />--> <result column="project_approval_type" property="projectApprovalType" /> <result column="investment_catalogue" property="investmentCatalogue" /> <result column="importance_type" property="importanceType" /> common/src/main/java/com/ycl/common/enums/business/FileTypeEnum.java
New file @@ -0,0 +1,24 @@ package com.ycl.common.enums.business; import com.fasterxml.jackson.annotation.JsonValue; import lombok.Getter; /** * 文件类型枚举 * * @author:flq * @date:2024/11/27 18:21 */ @Getter public enum FileTypeEnum { PROJECT_INFO("project_info", "项目基本信息"); private final String code; private final String desc; FileTypeEnum(String code, String desc) { this.code = code; this.desc = desc; } } system/src/main/java/com/ycl/system/domain/base/AbsEntity.java
@@ -18,7 +18,7 @@ private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.ASSIGN_ID) private Integer id; private Long id; /** 创建时间 */ @TableField(value = "gmt_create", fill = FieldFill.INSERT)