|
@@ -56,6 +56,11 @@ public class LabelImpl implements LabelService {
|
|
@Override
|
|
@Override
|
|
public int save(PcLabel data, String userId){
|
|
public int save(PcLabel data, String userId){
|
|
PcLabel model = pcLabelMapper.selectByPrimaryKey(data.getLabelID());
|
|
PcLabel model = pcLabelMapper.selectByPrimaryKey(data.getLabelID());
|
|
|
|
+ PcLabelExample labelExample = new PcLabelExample();
|
|
|
|
+ labelExample.or().andLabelTypeEqualTo(data.getLabelType()).andBigTypeEqualTo(data.getBigType()).andLabelNameEqualTo(data.getLabelName()).andLabelIDNotEqualTo(data.getLabelID());
|
|
|
|
+ if(pcLabelMapper.selectByExample(labelExample).size()>0){
|
|
|
|
+ throw new BaseException("1004","已存在相同名称的标签!");
|
|
|
|
+ }
|
|
if(model == null){
|
|
if(model == null){
|
|
model = new PcLabel();
|
|
model = new PcLabel();
|
|
model.setLabelID(data.getLabelID());
|
|
model.setLabelID(data.getLabelID());
|