diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index dc11d9a..fac13cb 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -54,49 +54,14 @@ public class DevInfoServiceImpl implements DevInfoService { @Override public DevInfoVo selectDevInfoByMaId(Long maId) { DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId); - //更新搜索量 - updateHotSearch(maId); - try { - List files = devInfoMapper.getFilesByMaId(maId); - if (!CollectionUtils.isEmpty(files) && files.get(0) != null) { - List picList = new ArrayList<>(); - for (SysFile file : files) { - if (file.getDicId().equals(ASPECT_PICTURE)) { - 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 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); + if (devInfoVo != null) { + //更新搜索量 + updateHotSearch(maId); + BmFileInfo bmFileInfo = new BmFileInfo(); + bmFileInfo.setModelId(devInfoVo.getMaId()); + bmFileInfo.setTaskType(17); + List fileList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo); + devInfoVo.setBmFileInfoList(fileList); } return devInfoVo; } diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 01e1c0f..550f5d8 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -145,34 +145,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.person as person, d.person_phone as personPhone, c.company_name as companyName, - h.search_num as searchNum + h.search_num as searchNum, + d.create_time as createTime FROM - ma_hot_search h - LEFT JOIN ma_dev_info d ON d.ma_id = h.ma_id + 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_status = '2' - - and d.ma_id = #{maId} - - order by h.search_num desc + order by d.create_time desc