|
@@ -2,6 +2,7 @@ package com.fs.system.service.impl;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
+import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.system.vo.DictVO;
|
|
import com.fs.system.vo.DictVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -85,6 +86,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|
|
@Override
|
|
@Override
|
|
|
public int insertDictData(SysDictData data)
|
|
public int insertDictData(SysDictData data)
|
|
|
{
|
|
{
|
|
|
|
|
+ // 数据库数据已经有问题了,唯一索引创建不了,在这个地方 dict_value dict_type 查询有记录不允许插入
|
|
|
|
|
+ SysDictData label = dictDataMapper.selectDictDataByTypeAndValue(data.getDictType(), data.getDictValue());
|
|
|
|
|
+ if(label != null) {
|
|
|
|
|
+ throw new ServiceException("字典数据已经存在,请更换数据键值");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
int row = dictDataMapper.insertDictData(data);
|
|
int row = dictDataMapper.insertDictData(data);
|
|
|
if (row > 0)
|
|
if (row > 0)
|
|
|
{
|
|
{
|