修改队列数据
This commit is contained in:
@@ -3,6 +3,7 @@ package cn.pluss.platform.sys.impl;
|
|||||||
import cn.pluss.platform.entity.QueueData;
|
import cn.pluss.platform.entity.QueueData;
|
||||||
import cn.pluss.platform.mapper.QueueDataMapper;
|
import cn.pluss.platform.mapper.QueueDataMapper;
|
||||||
import cn.pluss.platform.sys.QueueDataService;
|
import cn.pluss.platform.sys.QueueDataService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
@@ -29,14 +30,20 @@ public class QueueDataServiceImpl extends ServiceImpl<QueueDataMapper, QueueData
|
|||||||
public Integer newQueueData(String id) {
|
public Integer newQueueData(String id) {
|
||||||
QueueData entity = new QueueData();
|
QueueData entity = new QueueData();
|
||||||
entity.setId(id);
|
entity.setId(id);
|
||||||
|
QueryWrapper<QueueData> queryWrapper=new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("id",id);
|
||||||
|
int countId= baseMapper.selectCount(queryWrapper);
|
||||||
|
int count=-1;
|
||||||
|
if(countId<=0){
|
||||||
|
try {
|
||||||
|
count = baseMapper.insert(entity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int count;
|
|
||||||
try {
|
|
||||||
count = baseMapper.insert(entity);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user