新增渗压设备管理和渗流设备管理的删除功能
parent
4432bb56ba
commit
eceb1a00d8
|
|
@ -303,6 +303,12 @@ public class BasicDataController {
|
||||||
return R.ok(true);
|
return R.ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post(path = "/pztb/manage/delete/{id}",summary = "删除渗压设备接口")
|
||||||
|
public R<Boolean> deleteStSpgPztb(@Schema(description = "渗压设备ID") @PathVariable("id")String id){
|
||||||
|
stSpgPztbService.delete(id);
|
||||||
|
return R.ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
//渗流
|
//渗流
|
||||||
@Post(path = "/spprmp/search/query", summary = "查询渗流设备列表接口")
|
@Post(path = "/spprmp/search/query", summary = "查询渗流设备列表接口")
|
||||||
public R<Page<StSpgSpprmpVo>> queryStSpgSpprmpList(@Validated @RequestBody GeneralSearch search) {
|
public R<Page<StSpgSpprmpVo>> queryStSpgSpprmpList(@Validated @RequestBody GeneralSearch search) {
|
||||||
|
|
@ -330,4 +336,11 @@ public class BasicDataController {
|
||||||
stSpgSpprmpService.update(obj);
|
stSpgSpprmpService.update(obj);
|
||||||
return R.ok(true);
|
return R.ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get(path = "/spprmp/manage/delete/{id}",summary = "删除渗流设备接口")
|
||||||
|
public R<Boolean> deleteStSpgSpprmp(@Schema(description = "渗流设备ID") @PathVariable("id") String id){
|
||||||
|
stSpgSpprmpService.delete(id);
|
||||||
|
return R.ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.gunshi.project.xyt.service;
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.project.xyt.entity.basedata.CheckStringSearch;
|
import com.gunshi.project.xyt.entity.basedata.CheckStringSearch;
|
||||||
|
|
@ -81,6 +82,24 @@ public class StSpgPztbService {
|
||||||
stSpgPztbMapper.updateById(stSpgPztb);
|
stSpgPztbMapper.updateById(stSpgPztb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除渗压设备信息
|
||||||
|
* @param id 渗压设备ID
|
||||||
|
*/
|
||||||
|
public void delete(String id){
|
||||||
|
StSpgPztb stSpgPztb = stSpgPztbMapper.selectById(id);
|
||||||
|
if (stSpgPztb == null){
|
||||||
|
throw new IllegalArgumentException("该渗压设备ID不存在");
|
||||||
|
}
|
||||||
|
if (stSpgPztb.getStatus() == 0){
|
||||||
|
throw new IllegalArgumentException("该渗压设备已被禁用");
|
||||||
|
}
|
||||||
|
UpdateWrapper<StSpgPztb> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq(StSpgPztb.COL_ID,id)
|
||||||
|
.set(StSpgPztb.COL_STATUS,0);
|
||||||
|
stSpgPztbMapper.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查编码是否存在
|
* 检查编码是否存在
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.gunshi.project.xyt.service;
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.project.xyt.entity.basedata.CheckStringSearch;
|
import com.gunshi.project.xyt.entity.basedata.CheckStringSearch;
|
||||||
|
|
@ -81,6 +82,25 @@ public class StSpgSpprmpService {
|
||||||
stSpgSpprmpMapper.updateById(stSpgSpprmp);
|
stSpgSpprmpMapper.updateById(stSpgSpprmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除渗流设备信息
|
||||||
|
* @param id 渗流设备ID
|
||||||
|
*/
|
||||||
|
public void delete(String id){
|
||||||
|
StSpgSpprmp stSpgSpprmp = stSpgSpprmpMapper.selectById(id);
|
||||||
|
if (stSpgSpprmp == null){
|
||||||
|
throw new IllegalArgumentException("该渗流设备ID不存在");
|
||||||
|
}
|
||||||
|
if (stSpgSpprmp.getStatus() == 0){
|
||||||
|
throw new IllegalArgumentException("该渗流设备已被禁用");
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWrapper<StSpgSpprmp> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq(StSpgSpprmp.COL_ID,id)
|
||||||
|
.set(StSpgSpprmp.COL_STATUS,0);
|
||||||
|
stSpgSpprmpMapper.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查编码是否存在
|
* 检查编码是否存在
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue