删除无用的代码

This commit is contained in:
chenxudong 2025-01-07 16:18:30 +08:00
parent c15261d6d6
commit b492520470
10 changed files with 2 additions and 544 deletions

View File

@ -1,48 +0,0 @@
package com.electromagnetic.industry.software.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.electromagnetic.industry.software.manage.pojo.models.Category;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
/**
* 获取顶级节点
*
* @return
*/
List<Category> selectTopCategories();
/**
* 获取所有节点
*
* @return
*/
List<Category> selectAllCategories();
/**
* 获取节点通过编码ID
*
* @return
*/
List<Category> selectCategories(Category category);
/**
* 获取子节点通过父ID
*
* @return
*/
List<Category> selectChildCategories(Category category);
/**
* 创建目录树节点数据
*
* @return
*/
Boolean createCategory(Category category);
}

View File

@ -1,36 +0,0 @@
package com.electromagnetic.industry.software.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.electromagnetic.industry.software.manage.pojo.models.EDDataInfo;
import com.electromagnetic.industry.software.manage.pojo.other.EDDataParams;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface EDDataMapper extends BaseMapper<EDDataInfo> {
/**
* 创建文件/文件夹数据信息
*
* @param edDataInfo
* @return
*/
Boolean createDataInfo(EDDataInfo edDataInfo);
/**
* 获取文件信息列表
*
* @param parames
* @return
*/
List<EDDataInfo> getDataInfoList(EDDataParams parames);
/**
* 更新文件信息
*
* @param parames
* @return
*/
Boolean updateFileInfo(EDDataParams parames);
}

View File

@ -1,40 +0,0 @@
package com.electromagnetic.industry.software.manage.mapper;
import com.electromagnetic.industry.software.manage.pojo.models.EDDataInfo;
import com.electromagnetic.industry.software.manage.pojo.other.EDDataPage;
import com.electromagnetic.industry.software.manage.pojo.other.EDDataParams;
import com.electromagnetic.industry.software.manage.pojo.req.EDDataRequest;
import com.electromagnetic.industry.software.manage.pojo.resp.EDDataPageResponse;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface EDDataMappers {
EDDataMappers INSTANCE = Mappers.getMapper(EDDataMappers.class);
/**
* 文件数据扩展模型入参转换
*
* @param request
* @return
*/
EDDataParams getEDDataParames(EDDataRequest request);
/**
* 文件数据扩展模型入参转换
*
* @param request
* @return
*/
EDDataInfo getEDDataInfo(EDDataRequest request);
/**
* 指标卡扩展模型返回
*
* @param edDataPage
* @return
*/
EDDataPageResponse getEDDataInfoToModel(EDDataPage edDataPage);
}

View File

@ -1,84 +0,0 @@
package com.electromagnetic.industry.software.manage.pojo.models;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
@TableName("ed_category")
public class Category {
/**
* 主键ID
*/
private Long id;
/**
* 目录类型ID
*/
private String categoryTypeId;
/**
* 上级编码为空则为一级
*/
private String parentId;
/**
* 目录编码
*/
private String categoryId;
/**
* 目录名称
*/
private String categoryName;
/**
* 目录状态
*/
private String categoryStatus;
/**
* 创建人
*/
private String creator;
/**
* 创建人姓名
*/
private String creatorName;
/**
* 创建时间
*/
private Date gmtCreate;
/**
* 编辑人
*/
private String modifier;
/**
* 编辑人姓名
*/
private String modifierName;
/**
* 编辑时间
*/
private Date gmtModified;
/**
* 是否有效0-无效 1-有效
*/
private int effectFlag;
/**
* 子目录
*/
@TableField(exist = false)
private List<Category> children = new ArrayList<>();
}

View File

@ -1,99 +0,0 @@
package com.electromagnetic.industry.software.manage.pojo.models;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@TableName("ed_data_info")
@Data
public class EDDataInfo {
/**
* 主键ID
*/
private Long id;
/**
* 目录编码
*/
private String categoryId;
/**
* 数据编码
*/
private String dataId;
/**
* 数据可视化码
*/
private String dataNo;
/**
* 数据名称
*/
private String dataName;
/**
* 数据类型folder文件夹file文件
*/
private String dataType;
/**
* 文件类型
*/
private String fileType;
/**
* 当前版本
*/
private String version;
/**
* 富文本内容
*/
private String content;
/**
* 文件地址JSON
*/
private String implantJson;
/**
* 状态publish:发布occupy:占用
*/
private String dataStatus;
/**
* 备注
*/
private String note;
/**
* 编辑人
*/
private String editor;
/**
* 批量上传时间
*/
private Date gmtBatchUpload;
/**
* 保存状态
*/
private String saveStatus;
/**
* 创建人
*/
private String creator;
/**
* 创建人姓名
*/
private String creatorName;
/**
* 创建时间
*/
private Date gmtCreate;
/**
* 更新人
*/
private String modifier;
/**
* 更新人姓名
*/
private String modifierName;
/**
* 更新时间
*/
private Date gmtModified;
/**
* 是否有效:0-无效 1-有效
*/
private Integer effectFlag;
}

View File

@ -1,24 +0,0 @@
package com.electromagnetic.industry.software.manage.pojo.other;
import com.electromagnetic.industry.software.manage.pojo.models.EDDataInfo;
import com.github.pagehelper.PageInfo;
import lombok.Data;
import java.io.Serializable;
/**
* 分页综合返回
*
* @author
* @version $Id: IndicatorCardPage.java, v 0.1 2024-08-14 17:30
*/
@Data
public class EDDataPage implements Serializable {
private static final long serialVersionUID = -6207631048120337133L;
/**
* 电磁数据-文件数据列表
*/
private PageInfo<EDDataInfo> edDataInfo;
}

View File

@ -204,7 +204,7 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ElectromagneticResult<?> addFolder(String parentId, String folderName) { public ElectromagneticResult<?> addFolder(String parentId, String folderName) {
Assert.isTrue(EleCommonUtil.isFileNameValid(folderName), NAME_VALID_MSG); Assert.isTrue(EleCommonUtil.isFileNameValid(folderName), NAME_VALID_MSG);
// 检查当前目录下有文件如果有则不允许添加 // 检查当前目录下有文件如果有则不允许添加
long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class) long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(EdFileInfo.class)
.eq(EdFileInfo::getDataStatus, EleDataTypeEnum.FILE.code) .eq(EdFileInfo::getDataStatus, EleDataTypeEnum.FILE.code)
.eq(EdFileInfo::getParentId, parentId) .eq(EdFileInfo::getParentId, parentId)

View File

@ -1,77 +0,0 @@
<?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.electromagnetic.industry.software.manage.mapper.CategoryMapper">
<resultMap id="CategoryResultMap" type="com.electromagnetic.industry.software.manage.pojo.models.Category">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="category_type_id" jdbcType="VARCHAR" property="categoryTypeId"/>
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
<result column="category_id" jdbcType="VARCHAR" property="categoryId"/>
<result column="category_name" jdbcType="VARCHAR" property="categoryName"/>
<result column="category_status" jdbcType="VARCHAR" property="categoryStatus"/>
<result column="creator" jdbcType="VARCHAR" property="creator"/>
<result column="creator_name" jdbcType="VARCHAR" property="creatorName"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="modifier" jdbcType="VARCHAR" property="modifier"/>
<result column="modifier_name" jdbcType="VARCHAR" property="modifierName"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
<result column="effect_flag" jdbcType="TINYINT" property="effectFlag"/>
</resultMap>
<sql id="selectUserVo">
select category_type_id,
parent_id,
category_id,
category_name,
category_status,
creator,
creator_name,
gmt_create,
modifier,
modifier_name,
gmt_modified,
effect_flag
from ed_category
</sql>
<select id="selectTopCategories" resultMap="CategoryResultMap">
<include refid="selectUserVo"/>
where parent_id = 0 and category_status="available"
</select>
<select id="selectAllCategories" resultMap="CategoryResultMap">
<include refid="selectUserVo"/>
where category_status="available"
</select>
<select id="selectCategories" resultMap="CategoryResultMap"
parameterType="com.electromagnetic.industry.software.manage.pojo.models.Category">
<include refid="selectUserVo"/>
where category_id = #{categoryId,jdbcType=VARCHAR} and category_status="available"
</select>
<select id="selectChildCategories" resultMap="CategoryResultMap"
parameterType="com.electromagnetic.industry.software.manage.pojo.models.Category">
<include refid="selectUserVo"/>
where parent_id = #{parentId,jdbcType=VARCHAR} and category_status="available"
</select>
<insert id="createCategory" parameterType="com.electromagnetic.industry.software.manage.pojo.models.Category">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
replace into ed_data_info (id,
category_type_id, parent_id, category_id,
category_name, category_status,
creator, creator_name, gmt_create,
modifier, modifier_name, gmt_modified,
effect_flag
)
values (#{id,jdbcType=VARCHAR}, #{categoryTypeId,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
#{categoryName,jdbcType=VARCHAR}, #{categoryStatus,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR}, now(), #{modifier,jdbcType=VARCHAR},
#{modifierName,jdbcType=VARCHAR},now(),1
)
</insert>
</mapper>

View File

@ -1,134 +0,0 @@
<?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.electromagnetic.industry.software.manage.mapper.EDDataMapper">
<resultMap id="BaseResultMap" type="com.electromagnetic.industry.software.manage.pojo.models.EDDataInfo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="category_id" jdbcType="VARCHAR" property="categoryId"/>
<result column="data_id" jdbcType="VARCHAR" property="dataId"/>
<result column="data_no" jdbcType="VARCHAR" property="dataNo"/>
<result column="data_name" jdbcType="VARCHAR" property="dataName"/>
<result column="data_type" jdbcType="VARCHAR" property="dataType"/>
<result column="file_type" jdbcType="VARCHAR" property="fileType"/>
<result column="version" jdbcType="VARCHAR" property="version"/>
<result column="content" jdbcType="VARCHAR" property="content"/>
<result column="implant_json" jdbcType="VARCHAR" property="implantJson"/>
<result column="data_status" jdbcType="VARCHAR" property="dataStatus"/>
<result column="note" jdbcType="VARCHAR" property="note"/>
<result column="editor" jdbcType="VARCHAR" property="editor"/>
<result column="gmt_batch_upload" jdbcType="TIMESTAMP" property="gmtBatchUpload"/>
<result column="save_status" jdbcType="VARCHAR" property="saveStatus"/>
<result column="creator" jdbcType="VARCHAR" property="creator"/>
<result column="creator_name" jdbcType="VARCHAR" property="creatorName"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="modifier" jdbcType="VARCHAR" property="modifier"/>
<result column="modifier_name" jdbcType="VARCHAR" property="modifierName"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
<result column="effect_flag" jdbcType="TINYINT" property="effectFlag"/>
</resultMap>
<sql id="Base_Column_list">
id
,category_id,data_id,data_no,data_name,data_type,file_type,version,content,
implant_json,data_status,note,editor,gmt_batch_upload,save_status,creator,creator_name,gmt_create,modifier,modifier_name,
gmt_modified,effect_flag
</sql>
<insert id="createDataInfo" parameterType="com.electromagnetic.industry.software.manage.pojo.models.EDDataInfo">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
replace into ed_data_info (category_id,
data_id, data_no, data_name,
data_type, file_type, version,
content, implant_json, data_status,
note, editor, gmt_batch_upload, save_status,
creator, creator_name, gmt_create,
modifier, modifier_name, gmt_modified,
effect_flag
)
values (#{categoryId,jdbcType=VARCHAR},
#{dataId,jdbcType=VARCHAR}, #{dataNo,jdbcType=VARCHAR}, #{dataName,jdbcType=VARCHAR},
#{dataType,jdbcType=VARCHAR}, #{fileType,jdbcType=VARCHAR},#{version,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{implantJson,jdbcType=VARCHAR}, #{dataStatus,jdbcType=VARCHAR},
#{note,jdbcType=VARCHAR}, #{editor,jdbcType=VARCHAR}, #{gmtBatchUpload,jdbcType=TIMESTAMP},
#{saveStatus,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR}, now(), #{modifier,jdbcType=VARCHAR},
#{modifierName,jdbcType=VARCHAR},now(),1
)
</insert>
<select id="getDataInfoList" resultMap="BaseResultMap"
parameterType="com.electromagnetic.industry.software.manage.pojo.other.EDDataParams">
SELECT
<include refid="Base_Column_list"/>
FROM
ed_data_info
where
effect_flag = 1
<if test="parentId!=null and parentId!=''">
and category_id='${parentId}'
</if>
<if test="dataId!=null and dataId!=''">
and data_id='${dataId}'
</if>
<if test="keyWord!=null and keyWord!=''">
and data_name LIKE '%${keyWord}%'
</if>
<if test="dataType != null and dataType!=''">
and data_type = '${dataType}'
</if>
<if test="saveStatus!=null and saveStatus!=''">
and save_status='${saveStatus}'
</if>
GROUP BY id
<if test="gmtCreate == 'asc' or gmtCreate =='desc'">
order by gmt_create ${gmtCreate}
</if>
<if test="gmtCreate == null or gmtCreate == ''">
order by gmt_create desc
</if>
</select>
<update id="updateFileInfo" parameterType="com.electromagnetic.industry.software.manage.pojo.other.EDDataParams">
update ed_data_info
<set>
<if test="name != null and name!=''">
data_name = #{name,jdbcType=VARCHAR},
</if>
<if test="dataStatus != null and dataStatus!=''">
data_status = #{dataStatus,jdbcType=VARCHAR},
</if>
<if test="note != null and note!=''">
note = #{note,jdbcType=VARCHAR},
</if>
<if test="saveStatus != null and note!=''">
save_status = #{saveStatus,jdbcType=VARCHAR},
</if>
<if test="effectFlag != null and effectFlag!=''">
effect_flag = #{effectFlag,jdbcType=VARCHAR},
</if>
<if test="userId != null and userId!=''">
modifier = #{userId,jdbcType=VARCHAR},
</if>
<if test="userName != null and userName!=''">
modifier_name = #{userName,jdbcType=VARCHAR},
</if>
gmt_modified = now()
</set>
<where>
<!-- 条件 1按数据编码修改 -->
<if test="dataId != null and dataId != ''">
data_id = #{dataId,jdbcType=VARCHAR}
</if>
<!-- 条件 2按目录编码修改 -->
<if test="parentId != null and parentId != ''">
category_id = #{parentId,jdbcType=VARCHAR}
</if>
</where>
</update>
</mapper>

View File

@ -6,6 +6,6 @@
<select id="maxPrjId" resultType="java.lang.String"> <select id="maxPrjId" resultType="java.lang.String">
select max(id) select max(id)
from ed_file_info from ed_file_info
where length(id) = 6 where prj_dir = true
</select> </select>
</mapper> </mapper>