最新装备
This commit is contained in:
parent
bca4e13ada
commit
8396aaa448
|
|
@ -54,49 +54,14 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
@Override
|
@Override
|
||||||
public DevInfoVo selectDevInfoByMaId(Long maId) {
|
public DevInfoVo selectDevInfoByMaId(Long maId) {
|
||||||
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
|
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
|
||||||
//更新搜索量
|
if (devInfoVo != null) {
|
||||||
updateHotSearch(maId);
|
//更新搜索量
|
||||||
try {
|
updateHotSearch(maId);
|
||||||
List<SysFile> files = devInfoMapper.getFilesByMaId(maId);
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
if (!CollectionUtils.isEmpty(files) && files.get(0) != null) {
|
bmFileInfo.setModelId(devInfoVo.getMaId());
|
||||||
List<String> picList = new ArrayList<>();
|
bmFileInfo.setTaskType(17);
|
||||||
for (SysFile file : files) {
|
List<BmFileInfo> fileList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
|
||||||
if (file.getDicId().equals(ASPECT_PICTURE)) {
|
devInfoVo.setBmFileInfoList(fileList);
|
||||||
picList.add(file.getUrl());
|
|
||||||
}
|
|
||||||
if (file.getDicId().equals(EXAMINATION_PDF)) {
|
|
||||||
devInfoVo.setExaminationPdf(file.getUrl());
|
|
||||||
}
|
|
||||||
if (file.getDicId().equals(INSURANCE_PDF)) {
|
|
||||||
devInfoVo.setInsurancePdf(file.getUrl());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String[] pictureArray = null;
|
|
||||||
if (!CollectionUtils.isEmpty(picList)) {
|
|
||||||
pictureArray = picList.toArray(new String[0]);
|
|
||||||
}
|
|
||||||
devInfoVo.setPictures(pictureArray);
|
|
||||||
}
|
|
||||||
Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
|
|
||||||
devInfoVo.setCompanyUpNum(companyUpNum);
|
|
||||||
|
|
||||||
SysDic sysDic = devInfoMapper.getSysDicById(Integer.parseInt(devInfoVo.getMaStatus()));
|
|
||||||
devInfoVo.setMaStatusStr(sysDic.getName());
|
|
||||||
|
|
||||||
List<BaseAddress> addressList = devInfoMapper.getBaseAddress();
|
|
||||||
for (BaseAddress address : addressList) {
|
|
||||||
if (devInfoVo.getProvinceId().equals(Integer.valueOf(address.getCode()))) {
|
|
||||||
devInfoVo.setProvinceStr(address.getName());
|
|
||||||
}
|
|
||||||
if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) {
|
|
||||||
devInfoVo.setCityStr(address.getName());
|
|
||||||
}
|
|
||||||
if (devInfoVo.getAreaId().equals(Integer.valueOf(address.getCode()))) {
|
|
||||||
devInfoVo.setAreaStr(address.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.err.println("fail to get devInfo for files or companyUpNum or maStatusStr" + maId);
|
|
||||||
}
|
}
|
||||||
return devInfoVo;
|
return devInfoVo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,34 +145,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
d.person as person,
|
d.person as person,
|
||||||
d.person_phone as personPhone,
|
d.person_phone as personPhone,
|
||||||
c.company_name as companyName,
|
c.company_name as companyName,
|
||||||
h.search_num as searchNum
|
h.search_num as searchNum,
|
||||||
|
d.create_time as createTime
|
||||||
FROM
|
FROM
|
||||||
ma_hot_search h
|
ma_dev_info d
|
||||||
LEFT JOIN ma_dev_info d ON d.ma_id = h.ma_id
|
LEFT JOIN ma_hot_search h ON d.ma_id = h.ma_id
|
||||||
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||||
where
|
where
|
||||||
d.is_active='1'
|
d.is_active='1'
|
||||||
and d.ma_status = '2'
|
and d.ma_status = '2'
|
||||||
<if test="maId != null">
|
order by d.create_time desc
|
||||||
and d.ma_id = #{maId}
|
|
||||||
</if>
|
|
||||||
order by h.search_num desc
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDevInfoByMaId" parameterType="Long" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
<select id="selectDevInfoByMaId" parameterType="Long" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||||
select d.*,c.company_name,c.create_time as company_create_time,c.logo_url as company_logo_url,
|
SELECT
|
||||||
c.auth_phone, mt1.type_name as device_name,
|
d.ma_id as maId,
|
||||||
mt2.type_name as group_name, mt3.type_name as type_name,
|
d.code as code,
|
||||||
col.id as collect_id, h.search_num
|
d.device_name as deviceName,
|
||||||
from ma_dev_info d
|
d.device_weight as deviceWeight,
|
||||||
left join bm_company_info c on d.own_co = c.company_id
|
d.type_id as typeId,
|
||||||
left join ma_user_collect col on d.ma_id = col.ma_id
|
d.ma_status as maStatus,
|
||||||
left join ma_hot_search h on d.ma_id = h.ma_id
|
d.brand as brand,
|
||||||
left join ma_type_info t on d.type_id = t.type_id
|
d.model_name as modelName,
|
||||||
left join ma_type_info mt1 on d.type_id = mt1.type_id
|
d.production_date as productionDate,
|
||||||
left join ma_type_info mt2 on mt1.parent_id = mt2.type_id
|
d.working_hours as workingHours,
|
||||||
left join ma_type_info mt3 on mt2.parent_id = mt3.type_id
|
d.serial_number as serialNumber,
|
||||||
where d.ma_id = #{maId} and d.is_active='1'
|
d.month_lease_price as monthLeasePrice,
|
||||||
|
d.day_lease_price as dayLeasePrice,
|
||||||
|
d.person as person,
|
||||||
|
d.person_phone as personPhone,
|
||||||
|
c.company_name as companyName,
|
||||||
|
h.search_num as searchNum
|
||||||
|
FROM
|
||||||
|
ma_dev_info d
|
||||||
|
LEFT JOIN ma_hot_search h ON d.ma_id = h.ma_id
|
||||||
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||||
|
where
|
||||||
|
d.is_active='1' and d.ma_id = #{maId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile">
|
<select id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue