Browse Source

河道删除、河道详情

master
牧羊人 4 years ago
parent
commit
166b342cbe
5 changed files with 48 additions and 3 deletions
  1. +12
    -0
      src/main/java/com/taauav/admin/controller/TauvDriverController.java
  2. +1
    -1
      src/main/java/com/taauav/admin/controller/TauvEquipmentController.java
  3. +1
    -1
      src/main/java/com/taauav/admin/controller/TauvMountEquipmentController.java
  4. +8
    -0
      src/main/java/com/taauav/admin/service/ITauvDriverService.java
  5. +26
    -1
      src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java

+ 12
- 0
src/main/java/com/taauav/admin/controller/TauvDriverController.java View File

return iTauvDriverService.add(driver); return iTauvDriverService.add(driver);
} }


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

/** /**
* 查看河道详细数据 * 查看河道详细数据
* *

+ 1
- 1
src/main/java/com/taauav/admin/controller/TauvEquipmentController.java View File

*/ */
@PostMapping("/drop") @PostMapping("/drop")
@RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION) @RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION)
public Response drop(Integer id) {
public Response drop(@RequestBody Integer id) {
return iTauvEquipmentService.drop(id); return iTauvEquipmentService.drop(id);
} }



+ 1
- 1
src/main/java/com/taauav/admin/controller/TauvMountEquipmentController.java View File

*/ */
@PostMapping("/drop") @PostMapping("/drop")
@RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION) @RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION)
public Response drop(Integer id) {
public Response drop(@RequestBody Integer id) {
return tauvMountEquipmentService.drop(id); return tauvMountEquipmentService.drop(id);
} }



+ 8
- 0
src/main/java/com/taauav/admin/service/ITauvDriverService.java View File

*/ */
Response add(TauvDriver driver); Response add(TauvDriver driver);


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

/** /**
* 根据河道编号获取数据 * 根据河道编号获取数据
* *

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

import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taauav.admin.entity.LsAdmin; import com.taauav.admin.entity.LsAdmin;
import com.taauav.admin.entity.TauvEquipment;
import com.taauav.admin.mapper.LsAdminMapper; import com.taauav.admin.mapper.LsAdminMapper;
import com.taauav.admin.query.TauvDriverQuery; import com.taauav.admin.query.TauvDriverQuery;
import com.taauav.admin.service.ISysCityService; import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.service.ISysAdminService; import com.taauav.admin.service.ISysAdminService;
import com.taauav.admin.service.ITauvDriverService; import com.taauav.admin.service.ITauvDriverService;
import com.taauav.common.service.impl.BaseServiceImpl; import com.taauav.common.service.impl.BaseServiceImpl;
import com.taauav.common.util.DateUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
return response.success("添加成功"); return response.success("添加成功");
} }


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

/** /**
* 根据编号获取数据 * 根据编号获取数据
* *
map.put("start_point", info.getStartPoint()); map.put("start_point", info.getStartPoint());
map.put("end_point", info.getEndPoint()); map.put("end_point", info.getEndPoint());
map.put("type_list", driver.getTypeList()); map.put("type_list", driver.getTypeList());
map.put("format_create_time", driver.getCreateTime());
map.put("format_create_time", DateUtil.format(info.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
map.put("note", info.getNote());
SysAdmin adminInfo = null; SysAdmin adminInfo = null;
if (info.getCreateUser() > 0) { if (info.getCreateUser() > 0) {
adminInfo = iSysAdminService.findById(info.getCreateUser()); adminInfo = iSysAdminService.findById(info.getCreateUser());

Loading…
Cancel
Save