This commit is contained in:
sxu 2023-12-05 20:15:10 +08:00
parent 2b3d6e02a4
commit 4f7d272cac
3 changed files with 16 additions and 35 deletions

View File

@ -1,5 +1,7 @@
package com.bonus.zlpt.common.core.domain.system; package com.bonus.zlpt.common.core.domain.system;
import lombok.Data;
import lombok.ToString;
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;
@ -8,8 +10,15 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* *
* @author ruoyi * @author ruoyi
*/ */
@Data
@ToString
public class SysFile public class SysFile
{ {
/**
* 字典序号
*/
private Integer dicId;
/** /**
* 文件名称 * 文件名称
*/ */
@ -19,32 +28,4 @@ public class SysFile
* 文件地址 * 文件地址
*/ */
private String url; private String url;
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getUrl()
{
return url;
}
public void setUrl(String url)
{
this.url = url;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("name", getName())
.append("url", getUrl())
.toString();
}
} }

View File

@ -23,9 +23,9 @@ import javax.annotation.Resource;
@Service @Service
public class DevInfoServiceImpl implements IDevInfoService public class DevInfoServiceImpl implements IDevInfoService
{ {
private final String ASPECT_PICTURE = "ASPECT_PICTURE"; private final Integer ASPECT_PICTURE = 20;
private final String EXAMINATION_PDF = "EXAMINATION_PDF"; private final Integer EXAMINATION_PDF = 28;
private final String INSURANCE_PDF = "INSURANCE_PDF"; private final Integer INSURANCE_PDF = 29;
@Resource @Resource
private DevInfoMapper devInfoMapper; private DevInfoMapper devInfoMapper;
@ -46,13 +46,13 @@ public class DevInfoServiceImpl implements IDevInfoService
if (!CollectionUtils.isEmpty(files) && files.get(0) != null) { if (!CollectionUtils.isEmpty(files) && files.get(0) != null) {
List<String> picList = new ArrayList(); List<String> picList = new ArrayList();
for (SysFile file : files) { for (SysFile file : files) {
if (ASPECT_PICTURE.equals(file.getName())) { if (file.getDicId() == ASPECT_PICTURE) {
picList.add(file.getUrl()); picList.add(file.getUrl());
} }
if (EXAMINATION_PDF.equals(file.getName())) { if (file.getDicId() == EXAMINATION_PDF) {
devInfoVo.setExaminationPdf(file.getUrl()); devInfoVo.setExaminationPdf(file.getUrl());
} }
if (INSURANCE_PDF.equals(file.getName())) { if (file.getDicId() == INSURANCE_PDF) {
devInfoVo.setInsurancePdf(file.getUrl()); devInfoVo.setInsurancePdf(file.getUrl());
} }
} }

View File

@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.zlpt.common.core.domain.system.SysFile"> <select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.zlpt.common.core.domain.system.SysFile">
SELECT s.file_name as name,s.file_url as url SELECT s.dic_id, s.file_name as name,s.file_url as url
from ma_dev_info d from ma_dev_info d
left join sys_file_info s on d.ma_id = s.model_id left join sys_file_info s on d.ma_id = s.model_id
WHERE d.ma_id = #{maId} WHERE d.ma_id = #{maId}