Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
nmy 2023-12-09 11:38:16 +08:00
commit 6599ea248a
3 changed files with 34 additions and 18 deletions

View File

@ -84,4 +84,5 @@ public interface DevInfoMapper
int insertLon(InforMationDto inforMationDto); int insertLon(InforMationDto inforMationDto);
public List<SysDic> getSysDic(); public List<SysDic> getSysDic();
public SysDic getSysDicById(Integer id);
} }

View File

@ -17,6 +17,8 @@ import com.bonus.zlpt.equip.service.IDevInfoService;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import static com.bonus.zlpt.common.core.web.domain.AjaxResult.error;
/** /**
* 设备信息Service业务层处理 * 设备信息Service业务层处理
* *
@ -47,28 +49,34 @@ 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);
List<SysFile> files = devInfoMapper.getFilesByMaId(maId); try {
if (!CollectionUtils.isEmpty(files) && files.get(0) != null) { List<SysFile> files = devInfoMapper.getFilesByMaId(maId);
List<String> picList = new ArrayList(); if (!CollectionUtils.isEmpty(files) && files.get(0) != null) {
for (SysFile file : files) { List<String> picList = new ArrayList();
if (file.getDicId() == ASPECT_PICTURE) { for (SysFile file : files) {
picList.add(file.getUrl()); if (file.getDicId() == ASPECT_PICTURE) {
picList.add(file.getUrl());
}
if (file.getDicId() == EXAMINATION_PDF) {
devInfoVo.setExaminationPdf(file.getUrl());
}
if (file.getDicId() == INSURANCE_PDF) {
devInfoVo.setInsurancePdf(file.getUrl());
}
} }
if (file.getDicId() == EXAMINATION_PDF) { String[] pictureArray = null;
devInfoVo.setExaminationPdf(file.getUrl()); if (!CollectionUtils.isEmpty(picList)) {
} pictureArray = picList.toArray(new String[picList.size()]);
if (file.getDicId() == INSURANCE_PDF) {
devInfoVo.setInsurancePdf(file.getUrl());
} }
devInfoVo.setPictures(pictureArray);
} }
String[] pictureArray = null; Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
if (!CollectionUtils.isEmpty(picList)) { devInfoVo.setCompanyUpNum(companyUpNum);
pictureArray = picList.toArray(new String[picList.size()]); SysDic sysDic = devInfoMapper.getSysDicById(Integer.parseInt(devInfoVo.getMaStatus()));
} devInfoVo.setMaStatusStr(sysDic.getName());
devInfoVo.setPictures(pictureArray); } catch (Exception e) {
error("fail to get devInfo for files or companyUpNum or maStatusStr" + maId);
} }
Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
devInfoVo.setCompanyUpNum(companyUpNum);
return devInfoVo; return devInfoVo;
} }

View File

@ -347,4 +347,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator
from sys_dic from sys_dic
</select> </select>
<select id="getSysDicById" resultType="com.bonus.zlpt.system.api.domain.SysDic">
select
id,p_id,code,`name`,description,`value`,sort,`level`,status,create_time,creator
from sys_dic
where id = #{id}
</select>
</mapper> </mapper>