1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

分类管理增删改查完成

This commit is contained in:
2023-04-13 22:07:05 +08:00
parent 7dcf15fd79
commit bad6ecb111
19 changed files with 376 additions and 36 deletions

View File

@@ -43,7 +43,7 @@ public class FieldBuilder {
FieldType fieldType, SearchType searchType, AddType addType, EditType editType,
String searchPlaceholder, String addPlaceholder, String editPlaceholder,
FieldRuleListBuilder fieldRuleListBuilder, String mockDataPattern) {
JSONObject jsonObject = new JSONObject(2);
JSONObject jsonObject = new JSONObject();
/* 实际字段 */
// 用于筛选、增删改

View File

@@ -19,7 +19,7 @@ public class FieldMapperBuilder {
// if (mapper == null || mapper.size() == 0) {
// return this;
// }
// JSONObject jsonObject = new JSONObject(2);
// JSONObject jsonObject = new JSONObject(3);
// jsonObject.put("key", prop);
// jsonObject.put("value", label);
// jsonObject.put("mapper", mapper);
@@ -28,7 +28,7 @@ public class FieldMapperBuilder {
// }
public FieldMapperBuilder add(String prop, String label, HashMap mapper) {
JSONObject jsonObject = new JSONObject(2);
JSONObject jsonObject = new JSONObject(3);
jsonObject.put("key", prop);
jsonObject.put("value", label);
jsonObject.put("mapper", mapper);

View File

@@ -8,6 +8,7 @@ import org.springframework.beans.BeanUtils;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
// 数据库关系映射
@@ -38,4 +39,23 @@ public class GoodCategoryVO implements Serializable {
List<GoodCategoryVO> goodCategoryVOList = goodCategoryList.stream().map(GoodCategoryVO::convertFrom).collect(Collectors.toList());
return goodCategoryVOList;
}
public static GoodCategory convertTo(GoodCategoryVO goodCategoryVO) {
if (goodCategoryVO == null) {
return null;
}
GoodCategory goodCategory = new GoodCategory();
BeanUtils.copyProperties(goodCategoryVO, goodCategory);
try {
if (!Objects.isNull(goodCategoryVO.getId())) {
Long goodCategoryId = Long.valueOf(goodCategoryVO.getId());
goodCategory.setId(goodCategoryId);
} else {
goodCategory.setId(null);
}
} catch (Exception e) {
goodCategory.setId(null);
}
return goodCategory;
}
}