diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysFile.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysFile.java index 6783aa82..188a9033 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysFile.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysFile.java @@ -1,23 +1,29 @@ 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.ToStringStyle; +import java.util.Date; + /** * 文件信息 * * @author ruoyi */ +@Data public class SysFile { - /** + /* *//** * 文件名称 - */ + *//* private String name; - /** + *//** * 文件地址 - */ + *//* private String url; public String getName() @@ -46,5 +52,36 @@ public class SysFile .append("name", getName()) .append("url", getUrl()) .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; + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/FileInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/FileInfoMapper.java new file mode 100644 index 00000000..bf25e2f0 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/FileInfoMapper.java @@ -0,0 +1,25 @@ +package com.bonus.sgzb.material.mapper; + +import com.bonus.sgzb.system.api.domain.SysFile; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author laker + * @since 2021-08-05 + */ +public interface FileInfoMapper { + + /** + * 新增 + * @param fileIsList + * @return int + */ + List selectSysFileByFileIds(String[] fileIsList); + + SysFile selectSysFileInfoById(Long valueOf); +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java index c4543ce2..94d907c3 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairAuditDetailsServiceImpl.java @@ -20,6 +20,7 @@ import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.RepairAuditDetailsVO; import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -49,6 +50,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService @Resource private RepairTestInputMapper repairTestInputMapper; + @Resource + private FileInfoMapper sysFileMapper; + /** * 查询修试审核详细repair_apply_details @@ -288,6 +292,16 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService scrapApplyDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); scrapApplyDetails.setCreateTime(new Date()); 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); } } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/FileInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/FileInfoMapper.xml new file mode 100644 index 00000000..56fb512d --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/FileInfoMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + select id, model_id, file_name, file_url, dic_id, create_by, create_time from sys_file_info + + + + + + + + + insert into sys_file_info + + model_id, + file_name, + file_url, + dic_id, + create_by, + create_time, + + + #{modelId}, + #{fileName}, + #{fileUrl}, + #{dicId}, + #{createBy}, + #{createTime}, + + + + + update sys_file_info + + model_id = #{modelId}, + file_name = #{fileName}, + file_url = #{fileUrl}, + dic_id = #{dicId}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from sys_file_info where id = #{id} + + + + delete from sys_file_info where id in + + #{id} + + + \ No newline at end of file