报废原因和报废图片回显问题
This commit is contained in:
parent
ff06225e6e
commit
0190782966
|
|
@ -1,23 +1,29 @@
|
||||||
package com.bonus.sgzb.system.api.domain;
|
package com.bonus.sgzb.system.api.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件信息
|
* 文件信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class SysFile
|
public class SysFile
|
||||||
{
|
{
|
||||||
/**
|
/* *//**
|
||||||
* 文件名称
|
* 文件名称
|
||||||
*/
|
*//*
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 文件地址
|
* 文件地址
|
||||||
*/
|
*//*
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
|
|
@ -46,5 +52,36 @@ public class SysFile
|
||||||
.append("name", getName())
|
.append("name", getName())
|
||||||
.append("url", getUrl())
|
.append("url", getUrl())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 模块id */
|
||||||
|
private Long modelId;
|
||||||
|
/** 文件名称 */
|
||||||
|
@ApiModelProperty(value = "文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/** 文件路径 */
|
||||||
|
@ApiModelProperty(value = "文件路径")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/** 数据字典 */
|
||||||
|
@ApiModelProperty(value = "数据字典")
|
||||||
|
private Long dicId;
|
||||||
|
|
||||||
|
/** 创建者 */
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
private String ids;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
private String size;
|
||||||
|
private String type;
|
||||||
|
private int words;
|
||||||
|
private String creator;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.bonus.sgzb.material.mapper;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author laker
|
||||||
|
* @since 2021-08-05
|
||||||
|
*/
|
||||||
|
public interface FileInfoMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param fileIsList
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
List<SysFile> selectSysFileByFileIds(String[] fileIsList);
|
||||||
|
|
||||||
|
SysFile selectSysFileInfoById(Long valueOf);
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,7 @@ import com.bonus.sgzb.material.vo.GlobalContants;
|
||||||
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
|
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysFile;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -49,6 +50,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
@Resource
|
@Resource
|
||||||
private RepairTestInputMapper repairTestInputMapper;
|
private RepairTestInputMapper repairTestInputMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FileInfoMapper sysFileMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询修试审核详细repair_apply_details
|
* 查询修试审核详细repair_apply_details
|
||||||
|
|
@ -288,6 +292,16 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
scrapApplyDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
scrapApplyDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
scrapApplyDetails.setCreateTime(new Date());
|
scrapApplyDetails.setCreateTime(new Date());
|
||||||
scrapApplyDetails.setCompanyId((long) companyId);
|
scrapApplyDetails.setCompanyId((long) companyId);
|
||||||
|
scrapApplyDetails.setAuditRemark(bean.getScrapReason());
|
||||||
|
//根据fileIds获取所有的图片地址
|
||||||
|
String[] fileIsList = bean.getFileIds().split(",");
|
||||||
|
StringBuffer fileUrl = new StringBuffer();
|
||||||
|
for (int i = 0; i < fileIsList.length; i++) {
|
||||||
|
SysFile sysFile = sysFileMapper.selectSysFileInfoById(Long.valueOf(fileIsList[i]));
|
||||||
|
//对获取的图片地址进行拼接
|
||||||
|
fileUrl.append(","+sysFile.getFileUrl());
|
||||||
|
}
|
||||||
|
scrapApplyDetails.setFileUrl(fileUrl.toString());
|
||||||
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
<?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.sgzb.material.mapper.FileInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.bonus.sgzb.system.api.domain.SysFile" id="SysFileInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="modelId" column="model_id" />
|
||||||
|
<result property="fileName" column="file_name" />
|
||||||
|
<result property="fileUrl" column="file_url" />
|
||||||
|
<result property="dicId" column="dic_id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysFileInfoVo">
|
||||||
|
select id, model_id, file_name, file_url, dic_id, create_by, create_time from sys_file_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysFileInfoList" parameterType="com.bonus.sgzb.system.api.domain.SysFile" resultMap="SysFileInfoResult">
|
||||||
|
<include refid="selectSysFileInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="modelId != null "> and model_id = #{modelId}</if>
|
||||||
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||||
|
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||||
|
<if test="dicId != null "> and dic_id = #{dicId}</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysFileInfoById" parameterType="Long" resultMap="SysFileInfoResult">
|
||||||
|
<include refid="selectSysFileInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="selectSysFileByFileIds" resultType="com.bonus.sgzb.system.api.domain.SysFile">
|
||||||
|
|
||||||
|
<include refid="selectSysFileInfoVo"/>
|
||||||
|
where id In #{ids}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertFileInfo" parameterType="com.bonus.sgzb.system.api.domain.SysFile" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sys_file_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="modelId != null">model_id,</if>
|
||||||
|
<if test="fileName != null">file_name,</if>
|
||||||
|
<if test="fileUrl != null">file_url,</if>
|
||||||
|
<if test="dicId != null">dic_id,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="modelId != null">#{modelId},</if>
|
||||||
|
<if test="fileName != null">#{fileName},</if>
|
||||||
|
<if test="fileUrl != null">#{fileUrl},</if>
|
||||||
|
<if test="dicId != null">#{dicId},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSysFileInfo" parameterType="com.bonus.sgzb.system.api.domain.SysFile">
|
||||||
|
update sys_file_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="modelId != null">model_id = #{modelId},</if>
|
||||||
|
<if test="fileName != null">file_name = #{fileName},</if>
|
||||||
|
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||||
|
<if test="dicId != null">dic_id = #{dicId},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSysFileInfoById" parameterType="Long">
|
||||||
|
delete from sys_file_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSysFileInfoByIds" parameterType="String">
|
||||||
|
delete from sys_file_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue