Browse Source

飞行器设备、挂载设备、河流

master
牧羊人 4 years ago
parent
commit
31f66c09b3
5 changed files with 114 additions and 6 deletions
  1. +6
    -0
      src/main/java/com/taauav/admin/entity/TauvDriver.java
  2. +26
    -2
      src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java
  3. +0
    -4
      src/main/java/com/taauav/admin/vo/TauvDriverInfoVo.java
  4. +76
    -0
      src/main/java/com/taauav/admin/vo/TauvDriverListVo.java
  5. +6
    -0
      src/main/java/com/taauav/admin/vo/TauvMountEquipmentListVo.java

+ 6
- 0
src/main/java/com/taauav/admin/entity/TauvDriver.java View File

@@ -86,6 +86,12 @@ public class TauvDriver extends Entity {
*/
private BigInteger driverArea;

/**
* 备注
*/
@Length(max = 255, message = "备注最大长度为255")
private String note;

/**
* 河流类型
*

+ 26
- 2
src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java View File

@@ -1,10 +1,12 @@
package com.taauav.admin.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taauav.admin.query.TauvDriverQuery;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.vo.TauvDriverListVo;
import com.taauav.common.bean.Response;
import com.taauav.admin.entity.SysAdmin;
import com.taauav.admin.entity.TauvDriver;
@@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -70,7 +73,28 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
queryWrapper.orderByDesc("id");
IPage<TauvDriver> page = new Page<>(query.getPage(), query.getPageSize());
IPage<TauvDriver> data = driverMapper.selectPage(page, queryWrapper);
return response.success(data);
List<TauvDriver> driverList = data.getRecords();
List<TauvDriverListVo> driverListVoList = new ArrayList<>();
if (!driverList.isEmpty()) {
driverList.forEach(item -> {
TauvDriverListVo driverListVo = new TauvDriverListVo();
// 拷贝属性
BeanUtil.copyProperties(item, driverListVo);
// 区划名称
String cityName = cityService.getCityName(item.getDriverArea());
driverListVo.setDriverAreaName(cityName);
driverListVoList.add(driverListVo);
});
}

// 返回结果
Map<String, Object> result = new HashMap<>();
result.put("total", data.getTotal());
result.put("size", data.getSize());
result.put("current", data.getCurrent());
result.put("pages", data.getPages());
result.put("records", driverListVoList);
return response.success(result);
}

/**
@@ -191,7 +215,7 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
TauvDriver driver = new TauvDriver();
Map<String, Object> map = new HashMap<>(3);
map.put("type_list", driver.getTypeList());
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), false));
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), true));
map.put("level_list", driver.getLevelList());
return map;
}

+ 0
- 4
src/main/java/com/taauav/admin/vo/TauvDriverInfoVo.java View File

@@ -1,4 +0,0 @@
package com.taauav.admin.vo;

public class TauvDriverInfoVo {
}

+ 76
- 0
src/main/java/com/taauav/admin/vo/TauvDriverListVo.java View File

@@ -0,0 +1,76 @@
package com.taauav.admin.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;

/**
* 河流列表Vo
*/
@Data
public class TauvDriverListVo {

/**
* 河流ID
*/
private Integer id;

/**
* 河道编码
*/
private String driverSn;

/**
* 河道名称
*/
private String name;

/**
* 河道类型:1河流 2水库 3湖泊 4重点塘坝
*/
private Integer type;

/**
* 河道层级:3县/区 4镇 5村
*/
private Integer level;

/**
* 河长
*/
private String driverManager;

/**
* 河道长度(单位:km)
*/
private String length;

/**
* 起点
*/
private String startPoint;

/**
* 终点
*/
private String endPoint;

/**
* 区划ID
*/
private BigInteger driverArea;

/**
* 区划名称
*/
private String driverAreaName;

/**
* 备注
*/
private String note;

}

+ 6
- 0
src/main/java/com/taauav/admin/vo/TauvMountEquipmentListVo.java View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@@ -55,6 +56,11 @@ public class TauvMountEquipmentListVo {
*/
private Integer status;

/**
* 备注
*/
private String note;

/**
* 状态描述
*/

Loading…
Cancel
Save