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);
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 javax.annotation.Resource;
import static com.bonus.zlpt.common.core.web.domain.AjaxResult.error;
/**
* 设备信息Service业务层处理
*
@ -47,28 +49,34 @@ public class DevInfoServiceImpl implements IDevInfoService
public DevInfoVo selectDevInfoByMaId(Long maId)
{
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId);
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() == ASPECT_PICTURE) {
picList.add(file.getUrl());
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() == 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) {
devInfoVo.setExaminationPdf(file.getUrl());
}
if (file.getDicId() == INSURANCE_PDF) {
devInfoVo.setInsurancePdf(file.getUrl());
String[] pictureArray = null;
if (!CollectionUtils.isEmpty(picList)) {
pictureArray = picList.toArray(new String[picList.size()]);
}
devInfoVo.setPictures(pictureArray);
}
String[] pictureArray = null;
if (!CollectionUtils.isEmpty(picList)) {
pictureArray = picList.toArray(new String[picList.size()]);
}
devInfoVo.setPictures(pictureArray);
Long companyUpNum = devInfoMapper.getCompanyUpNum(devInfoVo.getOwnCo());
devInfoVo.setCompanyUpNum(companyUpNum);
SysDic sysDic = devInfoMapper.getSysDicById(Integer.parseInt(devInfoVo.getMaStatus()));
devInfoVo.setMaStatusStr(sysDic.getName());
} 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;
}

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
from sys_dic
</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>