New file |
| | |
| | | package cn.huge.module.file.controller.web; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.file.domain.po.FileInfo; |
| | | import cn.huge.module.file.service.FileInfoService; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @title: 附件信息表接口api-web端 |
| | | * @description: 附件信息表接口api-web端 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:18 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/web/fileInfo") |
| | | public class FileInfoWebController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private FileInfoService service; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.controller.web; |
| | | |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.file.domain.po.FileRelate; |
| | | import cn.huge.module.file.service.FileRelateService; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @title: 附件关系表接口api-web端 |
| | | * @description: 附件关系表接口api-web端 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/web/fileRelate") |
| | | public class FileRelateWebController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private FileRelateService service; |
| | | |
| | | /** |
| | | * 获取请求URL参数 |
| | | * @return Map<String, Object> |
| | | */ |
| | | private Map<String, Object> getParameter(){ |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 附件关系编号 |
| | | String id = request.getParameter("id"); |
| | | if (StringUtils.isNotBlank(id)){ |
| | | terms.put("id", id); |
| | | } |
| | | // 附件编号 |
| | | String fileId = request.getParameter("fileId"); |
| | | if (StringUtils.isNotBlank(fileId)){ |
| | | terms.put("fileId", fileId); |
| | | } |
| | | // 所属业务编号 |
| | | String ownerId = request.getParameter("ownerId"); |
| | | if (StringUtils.isNotBlank(ownerId)){ |
| | | terms.put("ownerId", ownerId); |
| | | } |
| | | // 所属业务大类 |
| | | String ownerCat = request.getParameter("ownerCat"); |
| | | if (StringUtils.isNotBlank(ownerCat)){ |
| | | terms.put("ownerCat", ownerCat); |
| | | } |
| | | // 所属业务类型 |
| | | String ownerType = request.getParameter("ownerType"); |
| | | if (StringUtils.isNotBlank(ownerType)){ |
| | | terms.put("ownerType", ownerType); |
| | | } |
| | | // 上传人编号 |
| | | String uploaderId = request.getParameter("uploaderId"); |
| | | if (StringUtils.isNotBlank(uploaderId)){ |
| | | terms.put("uploaderId", uploaderId); |
| | | } |
| | | // 上传人姓名 |
| | | String uploaderName = request.getParameter("uploaderName"); |
| | | if (StringUtils.isNotBlank(uploaderName)){ |
| | | terms.put("uploaderName", uploaderName); |
| | | } |
| | | // 上传人类型,1:工作人员,2:申请方,3:被申请方 |
| | | String uploaderType = request.getParameter("uploaderType"); |
| | | if (StringUtils.isNotBlank(uploaderType)){ |
| | | terms.put("uploaderType", uploaderType); |
| | | } |
| | | // 顾客编号 |
| | | String custId = request.getParameter("custId"); |
| | | if (StringUtils.isNotBlank(custId)){ |
| | | terms.put("custId", custId); |
| | | } |
| | | // 创建时间区间 |
| | | String createStart = request.getParameter("createStart"); |
| | | String createEnd = request.getParameter("createEnd"); |
| | | if(StringUtils.isNotBlank(createStart) && StringUtils.isNotBlank(createEnd)) { |
| | | terms.put("createStart", createStart); |
| | | terms.put("createEnd", createEnd); |
| | | } |
| | | // 更新时间区间 |
| | | String updateStart = request.getParameter("updateStart"); |
| | | String updateEnd = request.getParameter("updateEnd"); |
| | | if(StringUtils.isNotBlank(updateStart) && StringUtils.isNotBlank(updateEnd)) { |
| | | terms.put("updateStart", updateStart); |
| | | terms.put("updateEnd", updateEnd); |
| | | } |
| | | return terms; |
| | | } |
| | | |
| | | /** |
| | | * 条件查询多个 |
| | | * @url {ctx}/api/web/fileRelate/listQuery |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/listQuery") |
| | | public Object listQuery() { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | return ReturnSucUtils.getRepInfo(service.listTerms(terms)); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件分页查询 |
| | | * @url {ctx}/api/web/fileRelate/pageQuery |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageQuery") |
| | | public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { |
| | | try { |
| | | Map<String, Object> terms = getParameter(); |
| | | Sort sort = Sort.by(Sort.Direction.DESC, "create_time"); |
| | | PageRequest pageRequest = PageRequest.of(page-1, size, sort); |
| | | Page<FileRelate> fileRelatePage = service.pageQuery(pageRequest, terms); |
| | | return ReturnSucUtils.getRepInfo( "处理成功", fileRelatePage); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号查询单个 |
| | | * @url {ctx}/api/web/fileRelate/getById |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getById") |
| | | public Object getById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(service.getById(id)); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/fileRelate/deleteById |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @url {ctx}/api/web/fileRelate/saveFileRelate |
| | | * @param fileRelate 实体对象 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/saveFileRelate") |
| | | public Object saveFileRelate(@RequestBody FileRelate fileRelate) { |
| | | try { |
| | | service.saveFileRelate(fileRelate); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.dao.mapper; |
| | | |
| | | import cn.huge.module.file.domain.po.FileInfo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 附件信息表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface FileInfoMapper extends BaseMapper<FileInfo>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateFileInfo(@Param("entity") FileInfo entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateFileInfoTerms(@Param("entity") FileInfo entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteFileInfo(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<FileInfo> |
| | | */ |
| | | List<FileInfo> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<FileInfo> |
| | | */ |
| | | List<FileInfo> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.dao.mapper; |
| | | |
| | | import cn.huge.module.file.domain.po.FileRelate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 附件关系表持久层业务处理 |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | | public interface FileRelateMapper extends BaseMapper<FileRelate>{ |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | void updateFileRelate(@Param("entity") FileRelate entity); |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | void updateFileRelateTerms(@Param("entity") FileRelate entity, @Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | void deleteFileRelate(@Param("id") String id); |
| | | |
| | | /** |
| | | * 按条件查询结果集 |
| | | * @param terms 查询条件集合 |
| | | * @return List<FileRelate> |
| | | */ |
| | | List<FileRelate> listTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体总数 |
| | | * @param terms 查询条件集合 |
| | | * @return long |
| | | */ |
| | | long countTerms(@Param("terms") Map<String, Object> terms); |
| | | |
| | | /** |
| | | * 按条件查询实体分页结果集 |
| | | * @param page 分页对象 |
| | | * @param terms 查询条件集合 |
| | | * @return List<FileRelate> |
| | | */ |
| | | List<FileRelate> pageTerms(@Param("page") PageRequest page, @Param("terms") Map<String, Object> terms); |
| | | |
| | | } |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 附件信息表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-28 20:06:18 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.file.dao.mapper.FileInfoMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.file.domain.po.FileInfo"> |
| | | <result property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="trueName" column="true_name"/> |
| | | <result property="fileName" column="file_name"/> |
| | | <result property="suffix" column="suffix"/> |
| | | <result property="cat" column="cat"/> |
| | | <result property="size" column="size"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="md5Code" column="md5_code"/> |
| | | <result property="storeWay" column="store_way"/> |
| | | <result property="path" column="path"/> |
| | | <result property="fullPath" column="full_path"/> |
| | | <result property="showUrl" column="show_url"/> |
| | | <result property="downUrl" column="down_url"/> |
| | | <result property="zipUrl" column="zip_url"/> |
| | | <result property="deleteStatus" column="delete_status"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="createTime" column="create_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_file_info</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | name, |
| | | true_name, |
| | | file_name, |
| | | suffix, |
| | | cat, |
| | | size, |
| | | unit, |
| | | md5_code, |
| | | store_way, |
| | | path, |
| | | full_path, |
| | | show_url, |
| | | down_url, |
| | | zip_url, |
| | | delete_status, |
| | | cust_id, |
| | | update_time, |
| | | create_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.name != null">name = #{entity.name},</if> |
| | | <if test="entity.trueName != null">true_name = #{entity.trueName},</if> |
| | | <if test="entity.fileName != null">file_name = #{entity.fileName},</if> |
| | | <if test="entity.suffix != null">suffix = #{entity.suffix},</if> |
| | | <if test="entity.cat != null">cat = #{entity.cat},</if> |
| | | <if test="entity.size != null">size = #{entity.size},</if> |
| | | <if test="entity.unit != null">unit = #{entity.unit},</if> |
| | | <if test="entity.md5Code != null">md5_code = #{entity.md5Code},</if> |
| | | <if test="entity.storeWay != null">store_way = #{entity.storeWay},</if> |
| | | <if test="entity.path != null">path = #{entity.path},</if> |
| | | <if test="entity.fullPath != null">full_path = #{entity.fullPath},</if> |
| | | <if test="entity.showUrl != null">show_url = #{entity.showUrl},</if> |
| | | <if test="entity.downUrl != null">down_url = #{entity.downUrl},</if> |
| | | <if test="entity.zipUrl != null">zip_url = #{entity.zipUrl},</if> |
| | | <if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.name != null and terms.name !=''"> |
| | | and name = #{terms.name} |
| | | </if> |
| | | <if test="terms.trueName != null and terms.trueName !=''"> |
| | | and true_name = #{terms.trueName} |
| | | </if> |
| | | <if test="terms.fileName != null and terms.fileName !=''"> |
| | | and file_name = #{terms.fileName} |
| | | </if> |
| | | <if test="terms.suffix != null and terms.suffix !=''"> |
| | | and suffix = #{terms.suffix} |
| | | </if> |
| | | <if test="terms.cat != null and terms.cat !=''"> |
| | | and cat = #{terms.cat} |
| | | </if> |
| | | <if test="terms.size != null and terms.size !=''"> |
| | | and size = #{terms.size} |
| | | </if> |
| | | <if test="terms.unit != null and terms.unit !=''"> |
| | | and unit = #{terms.unit} |
| | | </if> |
| | | <if test="terms.md5Code != null and terms.md5Code !=''"> |
| | | and md5_code = #{terms.md5Code} |
| | | </if> |
| | | <if test="terms.storeWay != null and terms.storeWay !=''"> |
| | | and store_way = #{terms.storeWay} |
| | | </if> |
| | | <if test="terms.path != null and terms.path !=''"> |
| | | and path = #{terms.path} |
| | | </if> |
| | | <if test="terms.fullPath != null and terms.fullPath !=''"> |
| | | and full_path = #{terms.fullPath} |
| | | </if> |
| | | <if test="terms.showUrl != null and terms.showUrl !=''"> |
| | | and show_url = #{terms.showUrl} |
| | | </if> |
| | | <if test="terms.downUrl != null and terms.downUrl !=''"> |
| | | and down_url = #{terms.downUrl} |
| | | </if> |
| | | <if test="terms.zipUrl != null and terms.zipUrl !=''"> |
| | | and zip_url = #{terms.zipUrl} |
| | | </if> |
| | | <if test="terms.deleteStatus = null and terms.deleteStatus =''"> |
| | | and delete_status = '0' |
| | | </if> |
| | | <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> |
| | | and delete_status = #{terms.deleteStatus} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateFileInfo"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateFileInfoTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteFileInfo"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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"> |
| | | <!-- |
| | | * @title: 附件关系表 |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-28 20:06:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.file.dao.mapper.FileRelateMapper"> |
| | | <!-- 结果集 --> |
| | | <resultMap id="dataResult" type="cn.huge.module.file.domain.po.FileRelate"> |
| | | <result property="id" column="id"/> |
| | | <result property="fileId" column="file_id"/> |
| | | <result property="ownerId" column="owner_id"/> |
| | | <result property="ownerCat" column="owner_cat"/> |
| | | <result property="ownerType" column="owner_type"/> |
| | | <result property="uploaderId" column="uploader_id"/> |
| | | <result property="uploaderName" column="uploader_name"/> |
| | | <result property="uploaderType" column="uploader_type"/> |
| | | <result property="custId" column="cust_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <!-- 表 --> |
| | | <sql id='table-name'>dyh_file_relate</sql> |
| | | <!-- 字段 --> |
| | | <sql id="column-part"> |
| | | id, |
| | | file_id, |
| | | owner_id, |
| | | owner_cat, |
| | | owner_type, |
| | | uploader_id, |
| | | uploader_name, |
| | | uploader_type, |
| | | cust_id, |
| | | create_time, |
| | | update_time |
| | | </sql> |
| | | <!-- 更新实体字段 --> |
| | | <sql id="set-part"> |
| | | <if test="entity.fileId != null">file_id = #{entity.fileId},</if> |
| | | <if test="entity.ownerId != null">owner_id = #{entity.ownerId},</if> |
| | | <if test="entity.ownerCat != null">owner_cat = #{entity.ownerCat},</if> |
| | | <if test="entity.ownerType != null">owner_type = #{entity.ownerType},</if> |
| | | <if test="entity.uploaderId != null">uploader_id = #{entity.uploaderId},</if> |
| | | <if test="entity.uploaderName != null">uploader_name = #{entity.uploaderName},</if> |
| | | <if test="entity.uploaderType != null">uploader_type = #{entity.uploaderType},</if> |
| | | <if test="entity.custId != null">cust_id = #{entity.custId},</if> |
| | | <if test="entity.createTime != null">create_time = #{entity.createTime},</if> |
| | | <if test="entity.updateTime != null">update_time = #{entity.updateTime}</if> |
| | | </sql> |
| | | <!-- 条件 --> |
| | | <sql id="where-part"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | <if test="terms.id != null and terms.id !=''"> |
| | | and id = #{terms.id} |
| | | </if> |
| | | <if test="terms.fileId != null and terms.fileId !=''"> |
| | | and file_id = #{terms.fileId} |
| | | </if> |
| | | <if test="terms.ownerId != null and terms.ownerId !=''"> |
| | | and owner_id = #{terms.ownerId} |
| | | </if> |
| | | <if test="terms.ownerCat != null and terms.ownerCat !=''"> |
| | | and owner_cat = #{terms.ownerCat} |
| | | </if> |
| | | <if test="terms.ownerType != null and terms.ownerType !=''"> |
| | | and owner_type = #{terms.ownerType} |
| | | </if> |
| | | <if test="terms.uploaderId != null and terms.uploaderId !=''"> |
| | | and uploader_id = #{terms.uploaderId} |
| | | </if> |
| | | <if test="terms.uploaderName != null and terms.uploaderName !=''"> |
| | | and uploader_name = #{terms.uploaderName} |
| | | </if> |
| | | <if test="terms.uploaderType != null and terms.uploaderType !=''"> |
| | | and uploader_type = #{terms.uploaderType} |
| | | </if> |
| | | <if test="terms.custId != null and terms.custId !=''"> |
| | | and cust_id = #{terms.custId} |
| | | </if> |
| | | <if test="terms.createTime != null and terms.createTime !=''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime} |
| | | </if> |
| | | <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''"> |
| | | and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart} |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd}) |
| | | </if> |
| | | <if test="terms.updateTime != null and terms.updateTime !=''"> |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime} |
| | | </if> |
| | | <if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''"> |
| | | and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart} |
| | | and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | </sql> |
| | | <!-- 更新对象 --> |
| | | <update id="updateFileRelate"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <where> |
| | | id = #{entity.id} |
| | | </where> |
| | | </update> |
| | | <!-- 条件更新对象 --> |
| | | <update id="updateFileRelateTerms"> |
| | | update |
| | | <include refid="table-name"/> |
| | | <set> |
| | | <include refid="set-part"/> |
| | | </set> |
| | | <include refid="where-part"/> |
| | | </update> |
| | | <!-- 根据编号物理删除 --> |
| | | <delete id="deleteFileRelate"> |
| | | delete from |
| | | <include refid="table-name" /> |
| | | where id = #{id} |
| | | </delete> |
| | | <!-- 根据条件查询 --> |
| | | <select id="listTerms" resultMap="dataResult"> |
| | | select |
| | | <include refid="column-part"/> |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件统计 --> |
| | | <select id="countTerms" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | </select> |
| | | <!-- 根据条件分页查询 --> |
| | | <select id="pageTerms" resultMap="dataResult"> |
| | | SELECT |
| | | <include refid="column-part"/> |
| | | FROM |
| | | <include refid="table-name" /> |
| | | <include refid="where-part"/> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(create_time), create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package cn.huge.module.file.domain.bo; |
| | | |
| | | import cn.huge.module.file.domain.po.FileInfo; |
| | | |
| | | /** |
| | | * @title: 附件信息表业务扩展类 |
| | | * @description: 附件信息表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:18 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.file.domain.po.FileInfo |
| | | */ |
| | | public class FileInfoBO extends FileInfo { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.domain.bo; |
| | | |
| | | import cn.huge.module.file.domain.po.FileRelate; |
| | | |
| | | /** |
| | | * @title: 附件关系表业务扩展类 |
| | | * @description: 附件关系表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.file.domain.po.FileRelate |
| | | */ |
| | | public class FileRelateBO extends FileRelate { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 附件信息表数据库对应关系类 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_file_info") |
| | | @Data |
| | | public class FileInfo { |
| | | |
| | | /** |
| | | * 附件编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 附件展示名称(不带后缀) |
| | | */ |
| | | @TableField(value = "name") |
| | | private String name; |
| | | |
| | | /** |
| | | * 附件原本名称(不带后缀) |
| | | */ |
| | | @TableField(value = "true_name") |
| | | private String trueName; |
| | | |
| | | /** |
| | | * 附件存储名称(带后缀),保持唯一性 |
| | | */ |
| | | @TableField(value = "file_name") |
| | | private String fileName; |
| | | |
| | | /** |
| | | * 附件后缀(不带.),jpg|png|pdf|doc|docx|xsl|xslx 等 |
| | | */ |
| | | @TableField(value = "suffix") |
| | | private String suffix; |
| | | |
| | | /** |
| | | * 附件分类,音频|视频|图片等 |
| | | */ |
| | | @TableField(value = "cat") |
| | | private String cat; |
| | | |
| | | /** |
| | | * 附件大小 |
| | | */ |
| | | @TableField(value = "size") |
| | | private Double size; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @TableField(value = "unit") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 附件md5验证码 |
| | | */ |
| | | @TableField(value = "md5_code") |
| | | private String md5Code; |
| | | |
| | | /** |
| | | * 附件存储方式 |
| | | */ |
| | | @TableField(value = "store_way") |
| | | private String storeWay; |
| | | |
| | | /** |
| | | * 附件存储服务器路径 |
| | | */ |
| | | @TableField(value = "path") |
| | | private String path; |
| | | |
| | | /** |
| | | * 附件存储服务器完整路径 |
| | | */ |
| | | @TableField(value = "full_path") |
| | | private String fullPath; |
| | | |
| | | /** |
| | | * 附件查看地址 |
| | | */ |
| | | @TableField(value = "show_url") |
| | | private String showUrl; |
| | | |
| | | /** |
| | | * 附件下载地址 |
| | | */ |
| | | @TableField(value = "down_url") |
| | | private String downUrl; |
| | | |
| | | /** |
| | | * 压缩预览地址 |
| | | */ |
| | | @TableField(value = "zip_url") |
| | | private String zipUrl; |
| | | |
| | | /** |
| | | * 删除状态,0:已删除,1:未删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "delete_status") |
| | | private Integer deleteStatus; |
| | | |
| | | /** |
| | | * 顾客编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 状态时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.domain.po; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: 附件关系表数据库对应关系类 |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_file_relate") |
| | | @Data |
| | | public class FileRelate { |
| | | |
| | | /** |
| | | * 附件关系编号 |
| | | */ |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | /** |
| | | * 附件编号 |
| | | */ |
| | | @TableField(value = "file_id") |
| | | private String fileId; |
| | | |
| | | /** |
| | | * 所属业务编号 |
| | | */ |
| | | @TableField(value = "owner_id") |
| | | private String ownerId; |
| | | |
| | | /** |
| | | * 所属业务大类 |
| | | */ |
| | | @TableField(value = "owner_cat") |
| | | private String ownerCat; |
| | | |
| | | /** |
| | | * 所属业务类型 |
| | | */ |
| | | @TableField(value = "owner_type") |
| | | private String ownerType; |
| | | |
| | | /** |
| | | * 上传人编号 |
| | | */ |
| | | @TableField(value = "uploader_id") |
| | | private String uploaderId; |
| | | |
| | | /** |
| | | * 上传人姓名 |
| | | */ |
| | | @TableField(value = "uploader_name") |
| | | private String uploaderName; |
| | | |
| | | /** |
| | | * 上传人类型,1:工作人员,2:申请方,3:被申请方 |
| | | */ |
| | | @TableField(value = "uploader_type") |
| | | private Integer uploaderType; |
| | | |
| | | /** |
| | | * 顾客编号 |
| | | */ |
| | | @TableField(value = "cust_id") |
| | | private String custId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.service; |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.file.dao.mapper.FileInfoMapper; |
| | | import cn.huge.module.file.domain.po.FileInfo; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 附件信息表业务逻辑处理 |
| | | * @Description 附件信息表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-28 20:06:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class FileInfoService extends ServiceImpl<FileInfoMapper, FileInfo>{ |
| | | |
| | | @Autowired |
| | | private FileInfoMapper mapper; |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | public void updateFileInfo(FileInfo entity){ |
| | | try{ |
| | | mapper.updateFileInfo(entity); |
| | | }catch (Exception e){ |
| | | log.error("[FileInfoService.updateFileInfo]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileInfoService.updateFileInfo", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | public void updateFileInfoTerms(FileInfo entity, Map<String, Object> terms){ |
| | | try{ |
| | | mapper.updateFileInfoTerms(entity, terms); |
| | | }catch (Exception e){ |
| | | log.error("[FileInfoService.updateFileInfoTerms]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileInfoService.updateFileInfoTerms", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | public void deleteFileInfo(String id){ |
| | | try{ |
| | | mapper.deleteFileInfo(id); |
| | | }catch (Exception e){ |
| | | log.error("[FileInfoService.deleteFileInfo]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileInfoService.deleteFileInfo", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询 |
| | | * @param terms 条件 |
| | | * @return List |
| | | */ |
| | | public List<FileInfo> listTerms(Map<String, Object> terms){ |
| | | return mapper.listTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件统计 |
| | | * @param terms 条件 |
| | | * @return long |
| | | */ |
| | | public long countTerms(Map<String, Object> terms){ |
| | | return mapper.countTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<FileInfo> pageQuery(PageRequest page, Map<String, Object> terms){ |
| | | long total = mapper.countTerms(terms); |
| | | List<FileInfo> content = mapper.pageTerms(page, terms); |
| | | return new PageImpl<FileInfo>(content, page, total); |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @param fileInfo 实体对象 |
| | | */ |
| | | public void saveFileInfo(FileInfo fileInfo){ |
| | | try{ |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(fileInfo.getId())){ |
| | | fileInfo.setId(utilsClient.getNewTimeId()); |
| | | fileInfo.setCreateTime(nowDate); |
| | | } |
| | | fileInfo.setUpdateTime(nowDate); |
| | | this.saveOrUpdate(fileInfo); |
| | | }catch (Exception e){ |
| | | log.error("[FileInfoService.saveFileInfo]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileInfoService.saveFileInfo", e); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.file.service; |
| | | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.DateUtils; |
| | | import cn.huge.base.common.utils.IdUtils; |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.file.dao.mapper.FileRelateMapper; |
| | | import cn.huge.module.file.domain.po.FileRelate; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @title: 附件关系表业务逻辑处理 |
| | | * @Description 附件关系表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-28 20:06:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class FileRelateService extends ServiceImpl<FileRelateMapper, FileRelate>{ |
| | | |
| | | @Autowired |
| | | private FileRelateMapper mapper; |
| | | |
| | | @Autowired |
| | | private UtilsClientImpl utilsClient; |
| | | |
| | | /** |
| | | * 更新对象 |
| | | * @param entity 对象 |
| | | */ |
| | | public void updateFileRelate(FileRelate entity){ |
| | | try{ |
| | | mapper.updateFileRelate(entity); |
| | | }catch (Exception e){ |
| | | log.error("[FileRelateService.updateFileRelate]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileRelateService.updateFileRelate", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 条件更新对象 |
| | | * @param entity 对象 |
| | | * @param terms 条件 |
| | | */ |
| | | public void updateFileRelateTerms(FileRelate entity, Map<String, Object> terms){ |
| | | try{ |
| | | mapper.updateFileRelateTerms(entity, terms); |
| | | }catch (Exception e){ |
| | | log.error("[FileRelateService.updateFileRelateTerms]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileRelateService.updateFileRelateTerms", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据编号物理删除 |
| | | * @param id 查询条件集合 |
| | | */ |
| | | public void deleteFileRelate(String id){ |
| | | try{ |
| | | mapper.deleteFileRelate(id); |
| | | }catch (Exception e){ |
| | | log.error("[FileRelateService.deleteFileRelate]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileRelateService.deleteFileRelate", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 按条件查询 |
| | | * @param terms 条件 |
| | | * @return List |
| | | */ |
| | | public List<FileRelate> listTerms(Map<String, Object> terms){ |
| | | return mapper.listTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件统计 |
| | | * @param terms 条件 |
| | | * @return long |
| | | */ |
| | | public long countTerms(Map<String, Object> terms){ |
| | | return mapper.countTerms(terms); |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<FileRelate> pageQuery(PageRequest page, Map<String, Object> terms){ |
| | | long total = mapper.countTerms(terms); |
| | | List<FileRelate> content = mapper.pageTerms(page, terms); |
| | | return new PageImpl<FileRelate>(content, page, total); |
| | | } |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @param fileRelate 实体对象 |
| | | */ |
| | | public void saveFileRelate(FileRelate fileRelate){ |
| | | try{ |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(fileRelate.getId())){ |
| | | fileRelate.setId(utilsClient.getNewTimeId()); |
| | | fileRelate.setCreateTime(nowDate); |
| | | } |
| | | fileRelate.setUpdateTime(nowDate); |
| | | this.saveOrUpdate(fileRelate); |
| | | }catch (Exception e){ |
| | | log.error("[FileRelateService.saveFileRelate]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("FileRelateService.saveFileRelate", e); |
| | | } |
| | | } |
| | | |
| | | } |