|
@@ -3,6 +3,7 @@ package com.pavis.app.saasbacken.service.impl.base;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.pavis.app.saasbacken.common.IgnoreUtils;
|
|
import com.pavis.app.saasbacken.dao.*;
|
|
import com.pavis.app.saasbacken.dao.*;
|
|
import com.pavis.app.saasbacken.entity.*;
|
|
import com.pavis.app.saasbacken.entity.*;
|
|
import com.pavis.app.saasbacken.exception.IllegalArgumentException;
|
|
import com.pavis.app.saasbacken.exception.IllegalArgumentException;
|
|
@@ -71,7 +72,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<ModuleParam> moduleParams = new ArrayList<>();
|
|
List<ModuleParam> moduleParams = new ArrayList<>();
|
|
for (InitDataParent initDataParent : initDataParents) {
|
|
for (InitDataParent initDataParent : initDataParents) {
|
|
moduleParam = new ModuleParam();
|
|
moduleParam = new ModuleParam();
|
|
- BeanUtils.copyProperties(initDataParent, moduleParam);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(initDataParent, moduleParam);
|
|
|
|
|
|
// 二级目录
|
|
// 二级目录
|
|
List<InitDataChild> initDataChilds = initDataChildMapper.selectList(new QueryWrapper<InitDataChild>()
|
|
List<InitDataChild> initDataChilds = initDataChildMapper.selectList(new QueryWrapper<InitDataChild>()
|
|
@@ -81,7 +82,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
ModuleParam moduleParamChild;
|
|
ModuleParam moduleParamChild;
|
|
for (InitDataChild initDataChild : initDataChilds) {
|
|
for (InitDataChild initDataChild : initDataChilds) {
|
|
moduleParamChild = new ModuleParam();
|
|
moduleParamChild = new ModuleParam();
|
|
- BeanUtils.copyProperties(initDataChild, moduleParamChild);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(initDataChild, moduleParamChild);
|
|
childs.add(moduleParamChild);
|
|
childs.add(moduleParamChild);
|
|
|
|
|
|
// 三级目录
|
|
// 三级目录
|
|
@@ -92,7 +93,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<ModuleData> thirds = new ArrayList<>();
|
|
List<ModuleData> thirds = new ArrayList<>();
|
|
for (InitDataThird initDataThird : initDataThirds) {
|
|
for (InitDataThird initDataThird : initDataThirds) {
|
|
moduleParamThird = new ModuleParam();
|
|
moduleParamThird = new ModuleParam();
|
|
- BeanUtils.copyProperties(initDataThird, moduleParamThird);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(initDataThird, moduleParamThird);
|
|
thirds.add(moduleParamThird);
|
|
thirds.add(moduleParamThird);
|
|
}
|
|
}
|
|
moduleParamChild.setTrees(thirds);
|
|
moduleParamChild.setTrees(thirds);
|
|
@@ -121,7 +122,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<CheckModule> secCheckModules = new ArrayList<>();
|
|
List<CheckModule> secCheckModules = new ArrayList<>();
|
|
for (ModuleTree moduleTree : moduleTrees) {
|
|
for (ModuleTree moduleTree : moduleTrees) {
|
|
firstCheck = new CheckModule();
|
|
firstCheck = new CheckModule();
|
|
- BeanUtils.copyProperties(moduleTree, firstCheck);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(moduleTree, firstCheck);
|
|
firstCheck.setResType(moduleTree.getTitleCode());
|
|
firstCheck.setResType(moduleTree.getTitleCode());
|
|
firstCheck.setParentId("0");
|
|
firstCheck.setParentId("0");
|
|
firstCheckModules.add(firstCheck);
|
|
firstCheckModules.add(firstCheck);
|
|
@@ -130,7 +131,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
CheckModule secCheck;
|
|
CheckModule secCheck;
|
|
for (ModuleParam tree : moduleTree.getTrees()) {
|
|
for (ModuleParam tree : moduleTree.getTrees()) {
|
|
secCheck = new CheckModule();
|
|
secCheck = new CheckModule();
|
|
- BeanUtils.copyProperties(tree, secCheck);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(tree, secCheck);
|
|
secCheck.setResType(tree.getId());
|
|
secCheck.setResType(tree.getId());
|
|
secCheckModules.add(secCheck);
|
|
secCheckModules.add(secCheck);
|
|
|
|
|
|
@@ -138,7 +139,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
CheckModule thirdCheck;
|
|
CheckModule thirdCheck;
|
|
for (ModuleData treeTree : tree.getTrees()) {
|
|
for (ModuleData treeTree : tree.getTrees()) {
|
|
thirdCheck = new CheckModule();
|
|
thirdCheck = new CheckModule();
|
|
- BeanUtils.copyProperties(treeTree, thirdCheck);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(treeTree, thirdCheck);
|
|
thirdCheck.setResType(treeTree.getId());
|
|
thirdCheck.setResType(treeTree.getId());
|
|
thirdCheckModules.add(thirdCheck);
|
|
thirdCheckModules.add(thirdCheck);
|
|
|
|
|
|
@@ -181,7 +182,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<ModuleParam> moduleParams = new ArrayList<>();
|
|
List<ModuleParam> moduleParams = new ArrayList<>();
|
|
for (CheckModule module : checkModules1) {
|
|
for (CheckModule module : checkModules1) {
|
|
moduleParam = new ModuleParam();
|
|
moduleParam = new ModuleParam();
|
|
- BeanUtils.copyProperties(module, moduleParam);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(module, moduleParam);
|
|
|
|
|
|
// 二级
|
|
// 二级
|
|
List<ModuleData> childs = new ArrayList<>();
|
|
List<ModuleData> childs = new ArrayList<>();
|
|
@@ -190,7 +191,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
.lambda().eq(CheckModule::getParentId, module.getId()));
|
|
.lambda().eq(CheckModule::getParentId, module.getId()));
|
|
for (CheckModule checkModule1 : checkModules2) {
|
|
for (CheckModule checkModule1 : checkModules2) {
|
|
moduleParamChild = new ModuleParam();
|
|
moduleParamChild = new ModuleParam();
|
|
- BeanUtils.copyProperties(checkModule1, moduleParamChild);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(checkModule1, moduleParamChild);
|
|
childs.add(moduleParamChild);
|
|
childs.add(moduleParamChild);
|
|
|
|
|
|
// 三级
|
|
// 三级
|
|
@@ -200,7 +201,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
.lambda().eq(CheckModule::getParentId, checkModule1.getId()));
|
|
.lambda().eq(CheckModule::getParentId, checkModule1.getId()));
|
|
for (CheckModule checkModule2 : checkModules3) {
|
|
for (CheckModule checkModule2 : checkModules3) {
|
|
moduleParamThird = new ModuleParam();
|
|
moduleParamThird = new ModuleParam();
|
|
- BeanUtils.copyProperties(checkModule2, moduleParamThird);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(checkModule2, moduleParamThird);
|
|
thirds.add(moduleParamThird);
|
|
thirds.add(moduleParamThird);
|
|
}
|
|
}
|
|
moduleParamChild.setTrees(thirds);
|
|
moduleParamChild.setTrees(thirds);
|
|
@@ -415,7 +416,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<InitDataThird> initDataThirds = initDataThirdMapper.selectList(new QueryWrapper<InitDataThird>().lambda()
|
|
List<InitDataThird> initDataThirds = initDataThirdMapper.selectList(new QueryWrapper<InitDataThird>().lambda()
|
|
.eq(InitDataThird::getId, category.getParentId()));
|
|
.eq(InitDataThird::getId, category.getParentId()));
|
|
if (initDataThirds.size() > 0) {
|
|
if (initDataThirds.size() > 0) {
|
|
- BeanUtils.copyProperties(initDataThirds.get(0), allCategory);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(initDataThirds.get(0), allCategory);
|
|
allCategory.setParentId(category.getParentId());
|
|
allCategory.setParentId(category.getParentId());
|
|
// 根据parentid查询列表。
|
|
// 根据parentid查询列表。
|
|
List<Category> selCategories = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
List<Category> selCategories = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
@@ -425,19 +426,19 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
List<CategoryField> categoryFields = new ArrayList<>();
|
|
List<CategoryField> categoryFields = new ArrayList<>();
|
|
for (Category selCategory : selCategories) {
|
|
for (Category selCategory : selCategories) {
|
|
categoryField = new CategoryField();
|
|
categoryField = new CategoryField();
|
|
- BeanUtils.copyProperties(selCategory, categoryField);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(selCategory, categoryField);
|
|
categoryFields.add(categoryField);
|
|
categoryFields.add(categoryField);
|
|
}
|
|
}
|
|
allCategory.setFields(categoryFields);
|
|
allCategory.setFields(categoryFields);
|
|
allCategories.add(allCategory);
|
|
allCategories.add(allCategory);
|
|
}else {
|
|
}else {
|
|
// todo 用户自定义类目,暂时无法与数据进行关联。
|
|
// todo 用户自定义类目,暂时无法与数据进行关联。
|
|
- BeanUtils.copyProperties(category, allCategory);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(category, allCategory);
|
|
allCategory.setParentId(category.getParentId());
|
|
allCategory.setParentId(category.getParentId());
|
|
// 二级标签类目
|
|
// 二级标签类目
|
|
CategoryField categoryField = new CategoryField();
|
|
CategoryField categoryField = new CategoryField();
|
|
List<CategoryField> categoryFields = new ArrayList<>();
|
|
List<CategoryField> categoryFields = new ArrayList<>();
|
|
- BeanUtils.copyProperties(category, categoryField);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(category, categoryField);
|
|
categoryFields.add(categoryField);
|
|
categoryFields.add(categoryField);
|
|
allCategory.setFields(categoryFields);
|
|
allCategory.setFields(categoryFields);
|
|
allCategories.add(allCategory);
|
|
allCategories.add(allCategory);
|
|
@@ -527,14 +528,14 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
// 用户自定义:
|
|
// 用户自定义:
|
|
// 在原类目下新增
|
|
// 在原类目下新增
|
|
categoryField.setParentId(parentId);
|
|
categoryField.setParentId(parentId);
|
|
- BeanUtils.copyProperties(categoryField, tmpCategory);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(categoryField, tmpCategory);
|
|
tmpCategory.setCatCode("custom");
|
|
tmpCategory.setCatCode("custom");
|
|
tmpCategory.setModuleId("0");
|
|
tmpCategory.setModuleId("0");
|
|
tmpCategory.setCode(code);
|
|
tmpCategory.setCode(code);
|
|
} else {
|
|
} else {
|
|
// 在原类目下新增
|
|
// 在原类目下新增
|
|
categoryField.setParentId(parentId);
|
|
categoryField.setParentId(parentId);
|
|
- BeanUtils.copyProperties(categoryField, tmpCategory);
|
|
|
|
|
|
+ IgnoreUtils.copyPropertiesIgnoreNull(categoryField, tmpCategory);
|
|
tmpCategory.setCode(code);
|
|
tmpCategory.setCode(code);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|