Kaynağa Gözat

新增设备删除、获取河长列表

master
牧羊人 4 yıl önce
ebeveyn
işleme
6bc4efc577
22 değiştirilmiş dosya ile 172 ekleme ve 74 silme
  1. +10
    -0
      src/main/java/com/taauav/admin/controller/LsAdminController.java
  2. +13
    -0
      src/main/java/com/taauav/admin/controller/TauvEquipmentController.java
  3. +5
    -2
      src/main/java/com/taauav/admin/controller/TauvInspectDriverController.java
  4. +2
    -2
      src/main/java/com/taauav/admin/controller/TauvMountEquipmentController.java
  5. +1
    -1
      src/main/java/com/taauav/admin/controller/TauvReportController.java
  6. +1
    -1
      src/main/java/com/taauav/admin/entity/TauvDriver.java
  7. +2
    -1
      src/main/java/com/taauav/admin/entity/TauvEquipment.java
  8. +7
    -0
      src/main/java/com/taauav/admin/service/ILsAdminService.java
  9. +1
    -2
      src/main/java/com/taauav/admin/service/ISysCityService.java
  10. +0
    -8
      src/main/java/com/taauav/admin/service/ITauvCityService.java
  11. +8
    -0
      src/main/java/com/taauav/admin/service/ITauvEquipmentService.java
  12. +1
    -1
      src/main/java/com/taauav/admin/service/ITauvMountEquipmentService.java
  13. +32
    -1
      src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java
  14. +3
    -12
      src/main/java/com/taauav/admin/service/impl/SysCityServiceImpl.java
  15. +0
    -36
      src/main/java/com/taauav/admin/service/impl/TauvCityServiceImpl.java
  16. +11
    -1
      src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java
  17. +41
    -1
      src/main/java/com/taauav/admin/service/impl/TauvEquipmentServiceImpl.java
  18. +1
    -1
      src/main/java/com/taauav/admin/service/impl/TauvMountEquipmentServiceImpl.java
  19. +21
    -0
      src/main/java/com/taauav/admin/vo/LsDriverManagerListVo.java
  20. +7
    -2
      src/main/java/com/taauav/admin/vo/TauvDriverListVo.java
  21. +1
    -1
      src/main/java/com/taauav/admin/vo/TauvEquipmentListVo.java
  22. +4
    -1
      src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java

+ 10
- 0
src/main/java/com/taauav/admin/controller/LsAdminController.java Dosyayı Görüntüle

@@ -136,4 +136,14 @@ public class LsAdminController extends BaseController {
return response.success(lsAdminService.getBaseData());
}

/**
* 获取河长列表
*
* @return
*/
@PostMapping("/getDriverManagerList")
public Response getDriverManagerList() {
return lsAdminService.getDriverManagerList();
}

}

+ 13
- 0
src/main/java/com/taauav/admin/controller/TauvEquipmentController.java Dosyayı Görüntüle

@@ -1,6 +1,7 @@
package com.taauav.admin.controller;


import com.taauav.admin.entity.SysLevel;
import com.taauav.admin.query.EquipmentQuery;
import com.taauav.common.bean.Response;
import com.taauav.common.constant.PermissionConstants;
@@ -100,6 +101,18 @@ public class TauvEquipmentController {
return iTauvEquipmentService.add(tauvEquipment);
}

/**
* 删除设备
*
* @param id 设备ID
* @return
*/
@PostMapping("/drop")
@RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION)
public Response drop(Integer id) {
return iTauvEquipmentService.drop(id);
}

/**
* 设置状态
*

+ 5
- 2
src/main/java/com/taauav/admin/controller/TauvInspectDriverController.java Dosyayı Görüntüle

@@ -2,6 +2,7 @@ package com.taauav.admin.controller;


import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO;
import com.taauav.admin.entity.TauvEquipment;
import com.taauav.common.bean.Response;
import com.taauav.common.constant.PermissionConstants;
import com.taauav.admin.entity.TauvInspect;
@@ -191,9 +192,11 @@ public class TauvInspectDriverController {
result.put("typeList", tauvInspect.getTypeList());
//区域数组
//result.put("areaList",cityService.getCityListByPidAndAdmin(320100));
result.put("areaList", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), true));
//飞行小组
result.put("areaList", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117"))));
// 飞手
result.put("adminList", adminService.getAdminListByGroupId(6));
// 无人机设备类型
result.put("equipmentTypeList", new TauvEquipment().getTypeList());
return response.success("操作成功", result);
}


+ 2
- 2
src/main/java/com/taauav/admin/controller/TauvMountEquipmentController.java Dosyayı Görüntüle

@@ -100,8 +100,8 @@ public class TauvMountEquipmentController extends BaseController {
*/
@PostMapping("/drop")
@RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION)
public Response delete(Integer id) {
return tauvMountEquipmentService.delete(id);
public Response drop(Integer id) {
return tauvMountEquipmentService.drop(id);
}

/**

+ 1
- 1
src/main/java/com/taauav/admin/controller/TauvReportController.java Dosyayı Görüntüle

@@ -201,7 +201,7 @@ public class TauvReportController extends BaseController {
SysAdmin admin = ShiroUtils.getAdminInfo();
//区域数组
// result.put("areaList",cityService.getCityListByPidAndAdmin(320100));
result.put("areaList", cityService.getCityList(BigInteger.valueOf(320117), true));
result.put("areaList", cityService.getCityList(BigInteger.valueOf(320117)));
//状态数组
TauvReport report = new TauvReport();
result.put("statusList", report.getStatusList());

+ 1
- 1
src/main/java/com/taauav/admin/entity/TauvDriver.java Dosyayı Görüntüle

@@ -61,7 +61,7 @@ public class TauvDriver extends Entity {
*/
@NotEmpty(message = "河长不能为空")
@Length(min = 2, max = 30, message = "河长长度为2-30个字")
private String driverManager;
private Integer driverManager;

/**
* 河道长度(单位:km)

+ 2
- 1
src/main/java/com/taauav/admin/entity/TauvEquipment.java Dosyayı Görüntüle

@@ -76,7 +76,7 @@ public class TauvEquipment extends Entity {
/**
* 任务类型:1可见光 2多光谱
*/
private Integer taskType;
private String taskType;

/**
* 注册时间
@@ -96,6 +96,7 @@ public class TauvEquipment extends Entity {
Map<Integer, String> map = new HashMap<>();
map.put(1, "多旋翼");
map.put(2, "固定翼");
map.put(3, "垂直起降");
return map;
}


+ 7
- 0
src/main/java/com/taauav/admin/service/ILsAdminService.java Dosyayı Görüntüle

@@ -91,4 +91,11 @@ public interface ILsAdminService extends IBaseService<LsAdmin> {
*/
List<Integer> getAdminAuthData(Integer userId);

/**
* 获取河长列表
*
* @return
*/
Response getDriverManagerList();

}

+ 1
- 2
src/main/java/com/taauav/admin/service/ISysCityService.java Dosyayı Görüntüle

@@ -30,10 +30,9 @@ public interface ISysCityService extends IService<SysCity> {
* 获取城市列表
*
* @param pid
* @param isTree 是否树结构
* @return
*/
List<SysCity> getCityList(BigInteger pid, boolean isTree);
List<SysCity> getCityList(BigInteger pid);

/**
* 根据父级编号和用户信息获取城市列表

+ 0
- 8
src/main/java/com/taauav/admin/service/ITauvCityService.java Dosyayı Görüntüle

@@ -71,12 +71,4 @@ public interface ITauvCityService extends IService<SysCity> {
*/
Response getChildCityList(BigInteger pid);

// /**
// * 获取机构列表
// *
// * @param pid 上级ID
// * @return
// */
// List<TauvAgencyListVo> getAgencyList(BigInteger pid);

}

+ 8
- 0
src/main/java/com/taauav/admin/service/ITauvEquipmentService.java Dosyayı Görüntüle

@@ -41,6 +41,14 @@ public interface ITauvEquipmentService extends IBaseService<TauvEquipment> {
*/
Response add(TauvEquipment equipment);

/**
* 根据id删除设备
*
* @param id 设备ID
* @return
*/
Response drop(Integer id);

/**
* 修改设备状态
*

+ 1
- 1
src/main/java/com/taauav/admin/service/ITauvMountEquipmentService.java Dosyayı Görüntüle

@@ -56,7 +56,7 @@ public interface ITauvMountEquipmentService extends IBaseService<TauvMountEquipm
* @param id 设备ID
* @return
*/
Response delete(Integer id);
Response drop(Integer id);

/**
* 设置状态

+ 32
- 1
src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java Dosyayı Görüntüle

@@ -9,6 +9,7 @@ import com.taauav.admin.mapper.LsAuthGroupMapper;
import com.taauav.admin.service.ILsAuthGroupService;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.vo.LsAdminListVo;
import com.taauav.admin.vo.LsDriverManagerListVo;
import com.taauav.common.bean.Response;
import com.taauav.common.service.impl.BaseServiceImpl;
import com.taauav.common.util.FunctionUtils;
@@ -52,6 +53,7 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>

@Autowired
private LsAuthGroupMapper authGroupMapper;
private QueryWrapper<LsAdmin> queryWrapper;

/**
* 获取数据列表
@@ -236,7 +238,7 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
public Map<String, Object> getBaseData() {
Map<String, Object> map = new HashMap<>(2);
map.put("level_list", CommonConstant.LSADMIN_LEVEL_LIST);
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), true));
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117"))));
return map;
}

@@ -279,4 +281,33 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
}
return authDataList;
}

/**
* 获取河长列表
*
* @return
*/
@Override
public Response getDriverManagerList() {
// 查询条件
QueryWrapper<LsAdmin> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", 1);
queryWrapper.eq("mark", 1);
queryWrapper.orderByAsc("sort");
queryWrapper.select("id", "realname");

// 查询数据
List<LsAdmin> lsAdminList = lsAdminMapper.selectList(queryWrapper);
List<LsDriverManagerListVo> driverManagerListVoList = new ArrayList<>();
if (!lsAdminList.isEmpty()) {
lsAdminList.forEach(item -> {
LsDriverManagerListVo driverManagerListVo = new LsDriverManagerListVo();
// 拷贝属性
BeanUtils.copyProperties(item, driverManagerListVo);
driverManagerListVoList.add(driverManagerListVo);

});
}
return response.success(driverManagerListVoList);
}
}

+ 3
- 12
src/main/java/com/taauav/admin/service/impl/SysCityServiceImpl.java Dosyayı Görüntüle

@@ -56,12 +56,11 @@ public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> impl
/**
* 获取城市列表
*
* @param pid 上级ID
* @param isTree 是否树结构
* @param pid 上级ID
* @return
*/
@Override
public List<SysCity> getCityList(BigInteger pid, boolean isTree) {
public List<SysCity> getCityList(BigInteger pid) {
List<SysCity> cityList = new ArrayList<>();
if (pid.toString().equals("320117")) {
QueryWrapper<SysCity> queryWrapper2 = new QueryWrapper<>();
@@ -79,18 +78,10 @@ public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> impl
if (!list.isEmpty()) {
// 获取子级
list.forEach(item -> {
// 城市名称加层级修饰符
if (isTree) {
item.setName("|--" + item.getName());
}
cityList.add(item);
List<SysCity> children = this.getCityList(BigInteger.valueOf(Long.valueOf(item.getId().toString())), isTree);
List<SysCity> children = this.getCityList(BigInteger.valueOf(Long.valueOf(item.getId().toString())));
if (!children.isEmpty()) {
for (SysCity child : children) {
// 城市名称加层级修饰符
if (isTree) {
child.setName("|--" + child.getName());
}
cityList.add(child);
}
}

+ 0
- 36
src/main/java/com/taauav/admin/service/impl/TauvCityServiceImpl.java Dosyayı Görüntüle

@@ -183,40 +183,4 @@ public class TauvCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> imp
return response.success("设置成功");
}

// /**
// * 获取机构列表
// *
// * @param pid 上级ID
// * @return
// */
// @Override
// public List<TauvAgencyListVo> getAgencyList(BigInteger pid) {
// // 查询条件
// QueryWrapper<SysCity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("pid", pid);
// queryWrapper.eq("status", 1);
// queryWrapper.eq("mark", 1);
// queryWrapper.orderByAsc("sort");
//
// // 查询数据
// List<SysCity> tauvAgencyList = sysCityMapper.selectList(queryWrapper);
// List<TauvAgencyListVo> tauvAgencyListVoList = new ArrayList<>();
// if (!tauvAgencyList.isEmpty()) {
// tauvAgencyList.forEach(item -> {
// TauvAgencyListVo tauvAgencyListVo = new TauvAgencyListVo();
// // 拷贝属性
// BeanUtils.copyProperties(item, tauvAgencyListVo);
// tauvAgencyListVoList.add(tauvAgencyListVo);
// // 获取子级机构
// List<TauvAgencyListVo> children = getAgencyList(item.getId());
// if (!children.isEmpty()) {
// children.forEach(subItem -> {
// subItem.setName("|--" + subItem.getName());
// tauvAgencyListVoList.add(subItem);
// });
// }
// });
// }
// return tauvAgencyListVoList;
// }
}

+ 11
- 1
src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java Dosyayı Görüntüle

@@ -4,6 +4,8 @@ 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.entity.LsAdmin;
import com.taauav.admin.mapper.LsAdminMapper;
import com.taauav.admin.query.TauvDriverQuery;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.vo.TauvDriverListVo;
@@ -47,6 +49,8 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
private TauvDriverMapper driverMapper;
@Autowired
private ISysCityService cityService;
@Autowired
private LsAdminMapper lsAdminMapper;

/**
* 获取河道列表
@@ -84,6 +88,9 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
// 区划名称
String cityName = cityService.getCityName(item.getDriverArea());
driverListVo.setDriverAreaName(cityName);
// 河长名称
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager());
driverListVo.setDriverManagerName(lsAdmin.getRealname());
driverListVoList.add(driverListVo);
});
}
@@ -216,7 +223,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")), true));
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117"))));
map.put("level_list", driver.getLevelList());
return map;
}
@@ -261,6 +268,9 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
// 区划描述
String cityName = cityService.getCityName(item.getDriverArea());
driverListVo.setDriverAreaName(cityName);
// 河长名称
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager());
driverListVo.setDriverManagerName(lsAdmin.getRealname());
driverListVoList.add(driverListVo);
});
}

+ 41
- 1
src/main/java/com/taauav/admin/service/impl/TauvEquipmentServiceImpl.java Dosyayı Görüntüle

@@ -3,6 +3,7 @@ package com.taauav.admin.service.impl;
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.entity.LsAuthGroup;
import com.taauav.admin.entity.SysAdmin;
import com.taauav.admin.query.EquipmentQuery;
import com.taauav.admin.vo.TauvEquipmentListVo;
@@ -135,6 +136,28 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe
return response.success("操作成功");
}

/**
* 删除设备
*
* @param id 设备ID
* @return
*/
@Override
public Response drop(Integer id) {
if (id == null || id <= 0) {
return response.failure("设备ID不存在");
}
TauvEquipment entity = equipmentMapper.selectById(id);
if (entity == null) {
return response.failure("设备信息不存在");
}
boolean result = this.deleteById(id, entity);
if (!result) {
return response.failure("删除失败");
}
return response.success("删除成功");
}

/**
* 修改状态
*
@@ -228,7 +251,7 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe
// 设备类型
equipmentListVo.setTypeName(item.getTypeList().get(item.getType()));
// 任务类型
equipmentListVo.setTaskTypeName(item.getTaskTypeList().get(item.getTaskType()));
equipmentListVo.setTaskTypeName(this.getTaskTypeName(item.getTaskType()));
// 状态名称
equipmentListVo.setStatusName(item.getStatusList().get(item.getStatus()));
equipmentListVoList.add(equipmentListVo);
@@ -273,4 +296,21 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe
}
return stringList;
}

/**
* 根据任务类型ID获取任务名称
*
* @param taskType 任务类型
* @return
*/
public String getTaskTypeName(String taskType) {
List<String> stringList = new ArrayList<>();
String[] itemArr = taskType.split(",");
TauvEquipment equipment = new TauvEquipment();
for (String s : itemArr) {
String typeStr = equipment.getTaskTypeList().get(Integer.valueOf(s));
stringList.add(typeStr);
}
return org.apache.commons.lang3.StringUtils.join(stringList.toArray(), ",");
}
}

+ 1
- 1
src/main/java/com/taauav/admin/service/impl/TauvMountEquipmentServiceImpl.java Dosyayı Görüntüle

@@ -157,7 +157,7 @@ public class TauvMountEquipmentServiceImpl extends BaseServiceImpl<TauvMountEqui
* @return
*/
@Override
public Response delete(Integer id) {
public Response drop(Integer id) {
if (id == null || id <= 0) {
return response.failure("设备ID不存在");
}

+ 21
- 0
src/main/java/com/taauav/admin/vo/LsDriverManagerListVo.java Dosyayı Görüntüle

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

import lombok.Data;

/**
* 河长列表Vo
*/
@Data
public class LsDriverManagerListVo {

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

/**
* 河长姓名
*/
private String realname;

}

+ 7
- 2
src/main/java/com/taauav/admin/vo/TauvDriverListVo.java Dosyayı Görüntüle

@@ -44,9 +44,14 @@ public class TauvDriverListVo {
private Integer level;

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

/**
* 河长名称
*/
private String driverManagerName;

/**
* 河道长度(单位:km)

+ 1
- 1
src/main/java/com/taauav/admin/vo/TauvEquipmentListVo.java Dosyayı Görüntüle

@@ -66,7 +66,7 @@ public class TauvEquipmentListVo {
/**
* 任务类型:1可见光 2多光谱
*/
private Integer taskType;
private String taskType;

/**
* 任务类型描述

+ 4
- 1
src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java Dosyayı Görüntüle

@@ -102,7 +102,10 @@ public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvRep
queryWrapper.eq("mark", 1);

// 数据权限
// List<Integer> authDataList = adminService.getAdminAuthData()
List<Integer> authDataList = adminService.getAdminAuthData(userId);
if (authDataList.contains(1)) {
//
}


// 查询数据

Yükleniyor…
İptal
Kaydet