|
@@ -3,7 +3,9 @@ package com.sckj.warn.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.sckj.common.core.AjaxResult;
|
|
|
import com.sckj.common.util.StringUtils;
|
|
|
+import com.sckj.warn.entity.TAudio;
|
|
|
import com.sckj.warn.service.ITExceptionLogService;
|
|
|
import com.sckj.common.core.PageResult;
|
|
|
import com.sckj.common.util.TimeUtils;
|
|
@@ -23,6 +25,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
@@ -55,6 +58,7 @@ public class TExceptionLogServiceImpl implements ITExceptionLogService {
|
|
|
Integer limit = pageValidate.getPageSize();
|
|
|
|
|
|
QueryWrapper<TExceptionLog> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("del_flag", "1");
|
|
|
queryWrapper.orderByDesc("id");
|
|
|
|
|
|
/*数据库时间类型为datetime不可走setSearch()*/
|
|
@@ -97,7 +101,7 @@ public class TExceptionLogServiceImpl implements ITExceptionLogService {
|
|
|
public TExceptionLogDetailVo detail(Integer id) {
|
|
|
TExceptionLog model = tExceptionLogMapper.selectOne(
|
|
|
new QueryWrapper<TExceptionLog>()
|
|
|
- .eq("id", id)
|
|
|
+ .eq("id", id).eq("del_flag", "1")
|
|
|
.last("limit 1"));
|
|
|
|
|
|
Assert.notNull(model, "数据不存在");
|
|
@@ -154,12 +158,29 @@ public class TExceptionLogServiceImpl implements ITExceptionLogService {
|
|
|
public void del(Integer id) {
|
|
|
TExceptionLog model = tExceptionLogMapper.selectOne(
|
|
|
new QueryWrapper<TExceptionLog>()
|
|
|
- .eq("id", id)
|
|
|
- .last("limit 1"));
|
|
|
+ .eq("id", id)
|
|
|
+ .last("limit 1"));
|
|
|
|
|
|
Assert.notNull(model, "数据不存在!");
|
|
|
|
|
|
- tExceptionLogMapper.delete(new QueryWrapper<TExceptionLog>().eq("id", id));
|
|
|
+ model.setDelFlag("0");
|
|
|
+
|
|
|
+ tExceptionLogMapper.updateById(model);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult<Object> del_ex(List<Long> ids) {
|
|
|
+ List<TExceptionLog> models = tExceptionLogMapper.selectList(
|
|
|
+ new QueryWrapper<TExceptionLog>()
|
|
|
+ .in("id", ids));
|
|
|
+
|
|
|
+ if (CollectionUtils.isEmpty(models)){
|
|
|
+ return AjaxResult.failed("数据不存在");
|
|
|
+ }
|
|
|
+ TExceptionLog model = new TExceptionLog();
|
|
|
+ model.setDelFlag("0");
|
|
|
+ tExceptionLogMapper.update(model, new QueryWrapper<TExceptionLog>().in("id", ids));
|
|
|
+ return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
/**
|