修改队列数据
This commit is contained in:
parent
457b5ce724
commit
bcaea4df88
|
|
@ -3,6 +3,7 @@ package cn.pluss.platform.sys.impl;
|
|||
import cn.pluss.platform.entity.QueueData;
|
||||
import cn.pluss.platform.mapper.QueueDataMapper;
|
||||
import cn.pluss.platform.sys.QueueDataService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
|
|
@ -29,14 +30,20 @@ public class QueueDataServiceImpl extends ServiceImpl<QueueDataMapper, QueueData
|
|||
public Integer newQueueData(String id) {
|
||||
QueueData entity = new QueueData();
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue