fix
This commit is contained in:
parent
157102a957
commit
0c34b37fd6
|
|
@ -69,6 +69,14 @@ public class DevInfoVo extends DevInfo {
|
|||
private String monthLeasePriceOrderBy; // ASC or DESC
|
||||
@ApiModelProperty(value = "搜索装备更新时间排序 ASC or DESC")
|
||||
private String updateTimeOrderBy; // ASC or DESC
|
||||
@ApiModelProperty(value = "装备分类级别")
|
||||
private Integer level; //ma_type_level 级别: 1,2,3
|
||||
@ApiModelProperty(value = "装备状态")
|
||||
private String maStatusStr;
|
||||
@ApiModelProperty(value = "省份名称")
|
||||
private String provinceStr;
|
||||
@ApiModelProperty(value = "市名称")
|
||||
private String cityStr;
|
||||
@ApiModelProperty(value = "区名称")
|
||||
private String areaStr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import com.bonus.zlpt.common.core.domain.system.SysFile;
|
|||
import com.bonus.zlpt.equip.api.domain.DevInfo;
|
||||
import com.bonus.zlpt.equip.api.domain.dto.InforMationDto;
|
||||
import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo;
|
||||
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||
import com.bonus.zlpt.system.api.domain.SysDic;
|
||||
|
||||
|
||||
/**
|
||||
* 设备信息Mapper接口
|
||||
*
|
||||
|
|
@ -84,5 +84,10 @@ public interface DevInfoMapper
|
|||
int insertLon(InforMationDto inforMationDto);
|
||||
|
||||
public List<SysDic> getSysDic();
|
||||
|
||||
public SysDic getSysDicById(Integer id);
|
||||
|
||||
public List<BaseAddress> getBaseAddress();
|
||||
|
||||
public String getBaseAddressById(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.zlpt.equip.api.domain.dto.InforMationDto;
|
|||
import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo;
|
||||
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||
import com.bonus.zlpt.common.core.utils.DateUtils;
|
||||
import com.bonus.zlpt.system.api.domain.BaseAddress;
|
||||
import com.bonus.zlpt.system.api.domain.SysDic;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import com.bonus.zlpt.equip.mapper.SysFileInfoMapper;
|
||||
|
|
@ -72,8 +73,23 @@ public class DevInfoServiceImpl implements IDevInfoService
|
|||
}
|
||||
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 (String.valueOf(devInfoVo.getProvinceId()).equals(String.valueOf(address.getId()))) {
|
||||
devInfoVo.setProvinceStr(address.getName());
|
||||
}
|
||||
if (String.valueOf(devInfoVo.getCityId()).equals(String.valueOf(address.getId()))) {
|
||||
devInfoVo.setCityStr(address.getName());
|
||||
}
|
||||
if (String.valueOf(devInfoVo.getAreaId()).equals(String.valueOf(address.getId()))) {
|
||||
devInfoVo.setAreaStr(address.getName());
|
||||
}
|
||||
}
|
||||
// devInfoVo.setProvinceStr(devInfoMapper.getBaseAddressById(devInfoVo.getProvinceId()));
|
||||
} catch (Exception e) {
|
||||
error("fail to get devInfo for files or companyUpNum or maStatusStr" + maId);
|
||||
}
|
||||
|
|
@ -90,21 +106,27 @@ public class DevInfoServiceImpl implements IDevInfoService
|
|||
public List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo)
|
||||
{
|
||||
List<DevInfoVo> list = devInfoMapper.selectDevInfoList(devInfo);
|
||||
List<SysDic> sysDics = devInfoMapper.getSysDic();
|
||||
for (DevInfoVo devInfoVo : list) {
|
||||
for (SysDic sysDic : sysDics) {
|
||||
if (devInfoVo.getMaStatus().equals(String.valueOf(sysDic.getId()))) {
|
||||
devInfoVo.setMaStatusStr(sysDic.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
fillInMaStatusStr(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevInfoVo> selectDevInfoHotList(DevInfoVo devInfo)
|
||||
{
|
||||
return devInfoMapper.selectDevInfoHotList(devInfo);
|
||||
List<DevInfoVo> hotList = devInfoMapper.selectDevInfoHotList(devInfo);
|
||||
fillInMaStatusStr(hotList);
|
||||
return hotList;
|
||||
}
|
||||
|
||||
private void fillInMaStatusStr(List<DevInfoVo> hotList) {
|
||||
List<SysDic> sysDics = devInfoMapper.getSysDic();
|
||||
for (DevInfoVo devInfoVo : hotList) {
|
||||
for (SysDic sysDic : sysDics) {
|
||||
if (devInfoVo.getMaStatus().equals(String.valueOf(sysDic.getId()))) {
|
||||
devInfoVo.setMaStatusStr(sysDic.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -354,4 +354,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dic
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getBaseAddress" resultType="com.bonus.zlpt.system.api.domain.BaseAddress">
|
||||
select id,name from base_address where status = 1
|
||||
</select>
|
||||
|
||||
<select id="getBaseAddressById" resultType="String">
|
||||
select name from base_address where status = 1 and id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue