fix
This commit is contained in:
parent
0df8375a0c
commit
d3254353ca
|
|
@ -29,4 +29,6 @@ public class DevInfoVo extends DevInfo {
|
||||||
/* 是否审核通过, ma_up_off:status, 1=通过, 2驳回 */
|
/* 是否审核通过, ma_up_off:status, 1=通过, 2驳回 */
|
||||||
private String isAudit;
|
private String isAudit;
|
||||||
private Long searchNum;
|
private Long searchNum;
|
||||||
|
private String examinationPdf;
|
||||||
|
private String insurancePdf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.bonus.zlpt.common.core.domain.system;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class SysFile
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||||
|
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备信息Mapper接口
|
* 设备信息Mapper接口
|
||||||
|
|
@ -27,7 +28,7 @@ public interface DevInfoMapper
|
||||||
* @param maId 设备信息主键
|
* @param maId 设备信息主键
|
||||||
* @return 设备图片集
|
* @return 设备图片集
|
||||||
*/
|
*/
|
||||||
public String getPicturesByMaId(Long maId);
|
public List<SysFile> getFilesByMaId(Long maId);
|
||||||
|
|
||||||
public Long getCompanyUpNum(Long ownCo);
|
public Long getCompanyUpNum(Long ownCo);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||||
|
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备信息Service接口
|
* 设备信息Service接口
|
||||||
|
|
@ -22,14 +23,6 @@ public interface IDevInfoService
|
||||||
*/
|
*/
|
||||||
public DevInfoVo selectDevInfoByMaId(Long maId);
|
public DevInfoVo selectDevInfoByMaId(Long maId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询设备图片集
|
|
||||||
*
|
|
||||||
* @param maId 设备信息主键
|
|
||||||
* @return 设备图片集
|
|
||||||
*/
|
|
||||||
public String getPicturesByMaId(Long maId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备信息列表
|
* 查询设备信息列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
package com.bonus.zlpt.equip.service.impl;
|
package com.bonus.zlpt.equip.service.impl;
|
||||||
|
|
||||||
import java.util.IdentityHashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||||
|
|
||||||
import com.bonus.zlpt.common.core.domain.equip.TypeInfo;
|
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||||
import com.bonus.zlpt.common.core.utils.DateUtils;
|
import com.bonus.zlpt.common.core.utils.DateUtils;
|
||||||
import com.bonus.zlpt.common.core.utils.StringUtils;
|
import com.bonus.zlpt.common.core.utils.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -17,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.bonus.zlpt.equip.mapper.DevInfoMapper;
|
import com.bonus.zlpt.equip.mapper.DevInfoMapper;
|
||||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||||
import com.bonus.zlpt.equip.service.IDevInfoService;
|
import com.bonus.zlpt.equip.service.IDevInfoService;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备信息Service业务层处理
|
* 设备信息Service业务层处理
|
||||||
|
|
@ -27,6 +25,10 @@ import com.bonus.zlpt.equip.service.IDevInfoService;
|
||||||
@Service
|
@Service
|
||||||
public class DevInfoServiceImpl implements IDevInfoService
|
public class DevInfoServiceImpl implements IDevInfoService
|
||||||
{
|
{
|
||||||
|
private final String ASPECT_PICTURE = "ASPECT_PICTURE";
|
||||||
|
private final String EXAMINATION_PDF = "EXAMINATION_PDF";
|
||||||
|
private final String INSURANCE_PDF = "INSURANCE_PDF";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DevInfoMapper devInfoMapper;
|
private DevInfoMapper devInfoMapper;
|
||||||
|
|
||||||
|
|
@ -40,9 +42,24 @@ public class DevInfoServiceImpl implements IDevInfoService
|
||||||
public DevInfoVo selectDevInfoByMaId(Long maId)
|
public DevInfoVo selectDevInfoByMaId(Long maId)
|
||||||
{
|
{
|
||||||
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
|
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
|
||||||
String pictures = devInfoMapper.getPicturesByMaId(maId);
|
List<SysFile> files = devInfoMapper.getFilesByMaId(maId);
|
||||||
if (StringUtils.isNotEmpty(pictures)) {
|
if (!CollectionUtils.isEmpty(files)) {
|
||||||
String[] pictureArray = pictures.split(",");
|
List<String> picList = new ArrayList();
|
||||||
|
for (SysFile file : files) {
|
||||||
|
if (ASPECT_PICTURE.equals(file.getName())) {
|
||||||
|
picList.add(file.getUrl());
|
||||||
|
}
|
||||||
|
if (EXAMINATION_PDF.equals(file.getName())) {
|
||||||
|
devInfoVo.setExaminationPdf(file.getUrl());
|
||||||
|
}
|
||||||
|
if (INSURANCE_PDF.equals(file.getName())) {
|
||||||
|
devInfoVo.setInsurancePdf(file.getUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String[] pictureArray = null;
|
||||||
|
if (!CollectionUtils.isEmpty(picList)) {
|
||||||
|
pictureArray = picList.toArray(new String[picList.size()]);
|
||||||
|
}
|
||||||
devInfoVo.setPictures(pictureArray);
|
devInfoVo.setPictures(pictureArray);
|
||||||
}
|
}
|
||||||
Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
|
Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
|
||||||
|
|
@ -50,18 +67,6 @@ public class DevInfoServiceImpl implements IDevInfoService
|
||||||
return devInfoVo;
|
return devInfoVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询设备图片集
|
|
||||||
*
|
|
||||||
* @param maId 设备信息主键
|
|
||||||
* @return 设备图片集
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getPicturesByMaId(Long maId)
|
|
||||||
{
|
|
||||||
return devInfoMapper.getPicturesByMaId(maId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备信息列表
|
* 查询设备信息列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -107,12 +107,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where d.ma_id = #{maId}
|
where d.ma_id = #{maId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPicturesByMaId" parameterType="Long" resultType="String">
|
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.zlpt.common.core.domain.system.SysFile">
|
||||||
SELECT GROUP_CONCAT(sys.file_url)
|
SELECT 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 sys on d.ma_id = sys.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}
|
||||||
GROUP BY d.ma_id
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCompanyUpNum" parameterType="Long" resultType="Long">
|
<select id="getCompanyUpNum" parameterType="Long" resultType="Long">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue