最新装备

This commit is contained in:
mashuai 2024-11-22 18:03:53 +08:00
parent bca4e13ada
commit 8396aaa448
2 changed files with 37 additions and 63 deletions

View File

@ -54,49 +54,14 @@ public class DevInfoServiceImpl implements DevInfoService {
@Override
public DevInfoVo selectDevInfoByMaId(Long maId) {
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
if (devInfoVo != null) {
//更新搜索量
updateHotSearch(maId);
try {
List<SysFile> files = devInfoMapper.getFilesByMaId(maId);
if (!CollectionUtils.isEmpty(files) && files.get(0) != null) {
List<String> 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<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);
BmFileInfo bmFileInfo = new BmFileInfo();
bmFileInfo.setModelId(devInfoVo.getMaId());
bmFileInfo.setTaskType(17);
List<BmFileInfo> fileList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
devInfoVo.setBmFileInfoList(fileList);
}
return devInfoVo;
}

View File

@ -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'
<if test="maId != null">
and d.ma_id = #{maId}
</if>
order by h.search_num desc
order by d.create_time desc
</select>
<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,
c.auth_phone, mt1.type_name as device_name,
mt2.type_name as group_name, mt3.type_name as type_name,
col.id as collect_id, h.search_num
from ma_dev_info d
left join bm_company_info c on d.own_co = c.company_id
left join ma_user_collect col on d.ma_id = col.ma_id
left join ma_hot_search h on d.ma_id = h.ma_id
left join ma_type_info t on d.type_id = t.type_id
left join ma_type_info mt1 on d.type_id = mt1.type_id
left join ma_type_info mt2 on mt1.parent_id = mt2.type_id
left join ma_type_info mt3 on mt2.parent_id = mt3.type_id
where d.ma_id = #{maId} and d.is_active='1'
SELECT
d.ma_id as maId,
d.code as code,
d.device_name as deviceName,
d.device_weight as deviceWeight,
d.type_id as typeId,
d.ma_status as maStatus,
d.brand as brand,
d.model_name as modelName,
d.production_date as productionDate,
d.working_hours as workingHours,
d.serial_number as serialNumber,
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 id="getFilesByMaId" parameterType="Long" resultType="com.bonus.common.biz.domain.SysFile">