Commit 622f67d9 authored by zhangsen's avatar zhangsen

修改消防车辆接口返回值格式

parent ebfd1321
......@@ -13,5 +13,5 @@ public class CarInfoVO implements Serializable {
private String strCarNumber;
private List<String> carList;
private List<CarNumberVO> carList;
}
package com.yeejoin.amos.boot.module.ccs.api.vo;
import lombok.Data;
@Data
public class CarNumberVO {
private String carNum;
}
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo;
......@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService;
import com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO;
import com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO;
import com.yeejoin.amos.boot.module.ccs.api.vo.CarNumberVO;
import com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -157,8 +159,14 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
List<CarInfoVO> carInfoByStationCode = fireVehicleMapper.getCarInfoByStationCode(stationCode);
carInfoByStationCode.forEach(item -> {
if (StrUtil.isNotEmpty(item.getStrCarNumber())) {
List<CarNumberVO> carNumberVOS = new ArrayList<>();
List<String> list = Arrays.asList(item.getStrCarNumber().split(","));
item.setCarList(list);
list.forEach(carNum -> {
CarNumberVO carNumberVO = new CarNumberVO();
carNumberVO.setCarNum(carNum);
carNumberVOS.add(carNumberVO);
});
item.setCarList(carNumberVOS);
}
});
return carInfoByStationCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment