|
@@ -6,6 +6,7 @@ import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
|
import com.jpsoft.smart.modules.sys.entity.DataDictionary;
|
|
|
import com.jpsoft.smart.modules.sys.service.DataDictionaryService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -17,6 +18,7 @@ import java.util.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/sys/dataDictionary")
|
|
|
+@Api(description = "数据字典")
|
|
|
public class DataDictionaryController {
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
@@ -35,7 +37,7 @@ public class DataDictionaryController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value="添加信息")
|
|
|
@PostMapping("add")
|
|
|
public MessageResult<DataDictionary> add(@RequestBody DataDictionary dataDictionary,@RequestAttribute String subject){
|
|
@@ -46,7 +48,7 @@ public class DataDictionaryController {
|
|
|
dataDictionary.setDelFlag(false);
|
|
|
dataDictionary.setCreateBy(subject);
|
|
|
dataDictionary.setCreateDate(new Date());
|
|
|
-
|
|
|
+
|
|
|
int affectCount = dataDictionaryService.insert(dataDictionary);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
@@ -101,7 +103,7 @@ public class DataDictionaryController {
|
|
|
try {
|
|
|
dataDictionary.setUpdateBy(subject);
|
|
|
dataDictionary.setUpdateDate(new Date());
|
|
|
-
|
|
|
+
|
|
|
int affectCount = dataDictionaryService.update(dataDictionary);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
@@ -122,7 +124,7 @@ public class DataDictionaryController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="删除")
|
|
|
+ @ApiOperation(value="删除")
|
|
|
@PostMapping("delete/{id}")
|
|
|
public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
MessageResult<Integer> msgResult = new MessageResult<>();
|
|
@@ -164,7 +166,7 @@ public class DataDictionaryController {
|
|
|
|
|
|
for (String id : idList) {
|
|
|
DataDictionary dataDictionary = dataDictionaryService.get(id);
|
|
|
- //dataDictionary.setDelFlag(true);
|
|
|
+ dataDictionary.setDelFlag(true);
|
|
|
dataDictionary.setUpdateBy(subject);
|
|
|
dataDictionary.setUpdateDate(new Date());
|
|
|
|
|
@@ -194,6 +196,7 @@ public class DataDictionaryController {
|
|
|
public MessageResult<Map> pageList(
|
|
|
String id,
|
|
|
String name,
|
|
|
+ String parentId,
|
|
|
@RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
|
|
|
@RequestParam(name="pageSize",defaultValue = "10") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -208,6 +211,10 @@ public class DataDictionaryController {
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("sort_no","asc"));
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(parentId)) {
|
|
|
+ searchParams.put("parentId",parentId);
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
searchParams.put("id",id);
|
|
|
}
|