Commit c00f54fb authored by tangwei's avatar tangwei

修改bug

parent 459e37d0
package com.yeejoin.amos.boot.module.common.api.dto;
/**
* @description:
* @author: tw
* @createDate: 2022/3/3
*/
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@ApiModel(value = "车辆信息视图对象")
@Data
public class CarInfoDto implements Serializable {
@ApiModelProperty(value = "设备id")
private Long id;
@ApiModelProperty(value = "设备名称")
private String name;
@ApiModelProperty(value = "所属队伍")
private String teamId;
@ApiModelProperty(value = "所属队伍名称")
private String teamName;
@ApiModelProperty(value = "车牌号")
private String carNum;
@ApiModelProperty(value = "车辆类型")
private Long equipmentId;
@ApiModelProperty(value = "车辆类型名称")
private String equipmentName;
@ApiModelProperty(value = "分类id名称")
private String categoryName;
@ApiModelProperty(value = "分类id")
private Long categoryId;
@ApiModelProperty(value = "车辆状态")
private String carState;
@ApiModelProperty(value = "车辆状态描述")
private String carStateDesc;
@ApiModelProperty(value = "品牌")
private String brand;
@ApiModelProperty(value = "规格型号")
private String standard;
@ApiModelProperty(value = "底盘品牌")
private String chassisBrand;
@ApiModelProperty(value = "厂商id")
private Long manufacturerId;
@ApiModelProperty(value = "底盘国别")
private String chassisCountry;
@ApiModelProperty(value = "国别")
private String country;
@ApiModelProperty(value = "进口国产")
private Boolean isImport;
@ApiModelProperty(value = "二维码")
private String qrCode;
@ApiModelProperty(value = "保养周期")
private String maintenanceCycle;
@ApiModelProperty(value = "3c认证")
private Boolean cccAuth;
@ApiModelProperty(value = "物联编码")
private String iotCode;
@ApiModelProperty(value = "所属单位id(来源于平台)")
private String agencyId;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "车辆图片")
private List<String> image;
@ApiModelProperty(value = "车辆资源列表")
private List<Map<String, Object>> resourceList;
@ApiModelProperty(value = "绑定人姓名")
private String userName;
}
...@@ -4,6 +4,7 @@ import java.util.LinkedHashMap; ...@@ -4,6 +4,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.dto.CarInfoDto;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -86,13 +87,13 @@ public interface EquipFeignClient { ...@@ -86,13 +87,13 @@ public interface EquipFeignClient {
* @return * @return
*/ */
@RequestMapping(value = "/car/list-allpag", method = RequestMethod.GET) @RequestMapping(value = "/car/list-allpag", method = RequestMethod.GET)
ResponseModel<Object> equipmentCarList( @RequestParam("teamId") Long teamId, ResponseModel<Page<CarInfoDto>> equipmentCarList(@RequestParam("teamId") Long teamId,
@RequestParam("name") String name, @RequestParam("name") String name,
@RequestParam("code") String code , @RequestParam("code") String code ,
@RequestParam("pageNum") String pageNum, @RequestParam("pageNum") String pageNum,
@RequestParam("pageSize") String pageSize, @RequestParam("pageSize") String pageSize,
@RequestParam("id") Long id, @RequestParam("id") Long id,
@RequestParam("isNo") Boolean isNo ); @RequestParam("isNo") Boolean isNo );
......
...@@ -93,4 +93,7 @@ public class CarInfoDto implements Serializable { ...@@ -93,4 +93,7 @@ public class CarInfoDto implements Serializable {
@ApiModelProperty(value = "车辆资源列表") @ApiModelProperty(value = "车辆资源列表")
private List<Map<String, Object>> resourceList; private List<Map<String, Object>> resourceList;
@ApiModelProperty(value = "绑定人姓名")
private String userName;
} }
...@@ -13,5 +13,5 @@ import java.util.Map; ...@@ -13,5 +13,5 @@ import java.util.Map;
*人员与车辆信息 *人员与车辆信息
*/ */
public interface UserCarMapper extends BaseMapper<UserCar> { public interface UserCarMapper extends BaseMapper<UserCar> {
String selectListid();
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.api.service; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar; import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import java.util.List;
/** /**
* *
*/ */
...@@ -10,7 +12,8 @@ public interface IUserCarService { ...@@ -10,7 +12,8 @@ public interface IUserCarService {
UserCar selectByAmosUserId(Long id); UserCar selectByAmosUserId(Long id);
List<UserCar> selectList();
String selectListid();
void add(UserCar userCar); void add(UserCar userCar);
void delete(UserCar userCar); void delete(UserCar userCar);
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper">
<select id="selectListid" resultType="String">
select GROUP_CONCAT(car_id) id from jc_user_car where is_delete=0
</select>
</mapper> </mapper>
...@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto; ...@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService; import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.VideoFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.VideoFeignClient;
...@@ -1351,12 +1352,14 @@ public class CommandController extends BaseController { ...@@ -1351,12 +1352,14 @@ public class CommandController extends BaseController {
//获取用户所属单位id //获取用户所属单位id
AgencyUserModel agencyUserModel = getUserInfo(); AgencyUserModel agencyUserModel = getUserInfo();
Long teamId = null; Long teamId = null;
// Firefighters orgUsr= firefightersService.selectByAmosOrgId(Long.valueOf(agencyUserModel.getUserId())); Firefighters orgUsr= firefightersService.selectByAmosOrgId(Long.valueOf(agencyUserModel.getUserId()));
// teamId=orgUsr!=null?Long.valueOf(orgUsr.getFireTeamId()):null; teamId=orgUsr!=null?Long.valueOf(orgUsr.getFireTeamId()):null;
Long id = null; Long id = null;
//获取用户已绑定车辆id、 //获取用户已绑定车辆id、
UserCar userCar = userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId())); UserCar userCar = userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
List<UserCar> listcar = userCarService.selectList();
id = userCar != null ? userCar.getCarId() : null; id = userCar != null ? userCar.getCarId() : null;
if (id == null && isNo != null && isNo) { if (id == null && isNo != null && isNo) {
Map map = new HashMap(); Map map = new HashMap();
...@@ -1364,7 +1367,21 @@ public class CommandController extends BaseController { ...@@ -1364,7 +1367,21 @@ public class CommandController extends BaseController {
map.put("data", null); map.put("data", null);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
ResponseModel<Object> data = equipFeignClient.equipmentCarList(teamId, name, code, pageNum, pageSize, id, isNo); ResponseModel<Page<CarInfoDto>> data = equipFeignClient.equipmentCarList(teamId, name, code, pageNum, pageSize, id, isNo);
List<CarInfoDto> array=null;
if(data != null && data.getResult()!=null){
array = data.getResult().getRecords();
if(listcar!=null&&listcar.size()>0){
for (CarInfoDto carInfoDto : array) {
for (UserCar car : listcar) {
if(car.getCarId().longValue()==carInfoDto.getId().longValue()){
carInfoDto.setUserName(car.getAmosUserName());
}
}
}
}
}
data.getResult().setRecords(array);
Map map = new HashMap(); Map map = new HashMap();
map.put("select", userCar != null ? userCar.getCarId() : null); map.put("select", userCar != null ? userCar.getCarId() : null);
map.put("data", data != null ? data.getResult() : null); map.put("data", data != null ? data.getResult() : null);
......
...@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/** /**
* 航空器信息服务实现类 * 航空器信息服务实现类
...@@ -36,6 +38,16 @@ public class UserCarServiceImpl extends BaseService<AircraftDto, UserCar, UserCa ...@@ -36,6 +38,16 @@ public class UserCarServiceImpl extends BaseService<AircraftDto, UserCar, UserCa
} }
@Override @Override
public List<UserCar> selectList() {
return this.list();
}
@Override
public String selectListid() {
return UserCarMapper.selectListid();
}
@Override
public void add(UserCar userCar) { public void add(UserCar userCar) {
QueryWrapper<UserCar> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserCar> queryWrapper = new QueryWrapper<>();
......
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