|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package jnpf.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import jnpf.base.ActionResult;
|
|
|
|
@ -411,6 +412,15 @@ public class AreaRenameController {
|
|
|
|
|
@Operation(summary = "批量删除")
|
|
|
|
|
public ActionResult batchRemove(@RequestBody String ids){
|
|
|
|
|
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
|
|
|
|
|
for (String allId : idList) {
|
|
|
|
|
QueryWrapper<AreaEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(AreaEntity::getPid,allId);
|
|
|
|
|
queryWrapper.lambda().isNull(AreaEntity::getDeleteMark);
|
|
|
|
|
long lenght = areaService.count(queryWrapper);
|
|
|
|
|
if (lenght > 0){
|
|
|
|
|
return ActionResult.fail("该区域已配置空间数据,不能删除,请确认!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int i =0;
|
|
|
|
|
for (String allId : idList){
|
|
|
|
|
this.delete(allId);
|
|
|
|
@ -459,13 +469,21 @@ public class AreaRenameController {
|
|
|
|
|
@DeleteMapping("/{id}")
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult delete(@PathVariable("id") String id){
|
|
|
|
|
AreaEntity entity= areaService.getInfo(id);
|
|
|
|
|
if(entity!=null){
|
|
|
|
|
//假删除
|
|
|
|
|
entity.setDeleteMark(1);
|
|
|
|
|
areaService.update(id,entity);
|
|
|
|
|
QueryWrapper<AreaEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(AreaEntity::getPid,id);
|
|
|
|
|
queryWrapper.lambda().isNull(AreaEntity::getDeleteMark);
|
|
|
|
|
long lenght = areaService.count(queryWrapper);
|
|
|
|
|
if (lenght > 0){
|
|
|
|
|
return ActionResult.fail("该区域已配置空间数据,不能删除,请确认!");
|
|
|
|
|
}else {
|
|
|
|
|
AreaEntity entity = areaService.getInfo(id);
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
//假删除
|
|
|
|
|
entity.setDeleteMark(1);
|
|
|
|
|
areaService.update(id, entity);
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("删除成功");
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("删除成功");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 表单信息(详情页)
|
|
|
|
|