|
@@ -92,11 +92,11 @@ public class SysDictDataController extends BaseController
|
|
|
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
|
|
{
|
|
|
dict.setCreateBy(getUsername());
|
|
|
- List<SysDictData> sysDictData = dictTypeService.selectDictDataByType(dict.getDictType());
|
|
|
+ SysDictData sysDictData = dictDataService.selectMaxIdDictByType(dict.getDictType());
|
|
|
if(sysDictData == null){
|
|
|
dict.setDictValue("1");
|
|
|
}else{
|
|
|
- Integer size = sysDictData.size() + 1;
|
|
|
+ Integer size = Integer.parseInt(sysDictData.getDictValue()) + 1;
|
|
|
dict.setDictValue(size.toString());
|
|
|
}
|
|
|
return toAjax(dictDataService.insertDictData(dict));
|