|
@@ -6,12 +6,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.pavis.app.saasbacken.dao.*;
|
|
|
import com.pavis.app.saasbacken.entity.*;
|
|
|
import com.pavis.app.saasbacken.exception.IllegalArgumentException;
|
|
|
-import com.pavis.app.saasbacken.form.ModuleData;
|
|
|
-import com.pavis.app.saasbacken.form.ModuleParam;
|
|
|
-import com.pavis.app.saasbacken.form.ModuleTree;
|
|
|
+import com.pavis.app.saasbacken.form.*;
|
|
|
import com.pavis.app.saasbacken.http.ErrorCode;
|
|
|
import com.pavis.app.saasbacken.service.CategoryService;
|
|
|
import com.pavis.app.saasbacken.service.CheckModuleService;
|
|
|
+import com.pavis.app.saasbacken.service.DicService;
|
|
|
+import com.pavis.app.saasbacken.utils.CommonUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -19,8 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -54,6 +53,12 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
@Autowired
|
|
|
private CategoryService categoryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CategoryMapper categoryMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DicService dicService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<ModuleParam> selModules() {
|
|
|
// 父类数据。
|
|
@@ -101,11 +106,11 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
@Override
|
|
|
public List<CheckModule> addInitData(List<ModuleTree> moduleTrees) {
|
|
|
List<CheckModule> checkModules = checkModuleMapper.selectList(new QueryWrapper<CheckModule>().lambda().isNotNull(CheckModule::getId));
|
|
|
- if (checkModules.size() > 0){
|
|
|
+ if (checkModules.size() > 0) {
|
|
|
// 先删除,后新增。
|
|
|
List<String> ids = checkModules.stream().map(t -> t.getId()).collect(Collectors.toList());
|
|
|
int i = checkModuleMapper.deleteBatchIds(ids);
|
|
|
- log.info("del res:{}",i);
|
|
|
+ log.info("del res:{}", i);
|
|
|
}
|
|
|
|
|
|
// 一级数据
|
|
@@ -115,7 +120,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
List<CheckModule> secCheckModules = new ArrayList<>();
|
|
|
for (ModuleTree moduleTree : moduleTrees) {
|
|
|
firstCheck = new CheckModule();
|
|
|
- BeanUtils.copyProperties(moduleTree,firstCheck);
|
|
|
+ BeanUtils.copyProperties(moduleTree, firstCheck);
|
|
|
firstCheck.setResType(moduleTree.getTitleCode());
|
|
|
firstCheck.setParentId("0");
|
|
|
firstCheckModules.add(firstCheck);
|
|
@@ -124,7 +129,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
CheckModule secCheck;
|
|
|
for (ModuleParam tree : moduleTree.getTrees()) {
|
|
|
secCheck = new CheckModule();
|
|
|
- BeanUtils.copyProperties(tree,secCheck);
|
|
|
+ BeanUtils.copyProperties(tree, secCheck);
|
|
|
secCheck.setResType(tree.getId());
|
|
|
secCheckModules.add(secCheck);
|
|
|
|
|
@@ -132,7 +137,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
CheckModule thirdCheck;
|
|
|
for (ModuleData treeTree : tree.getTrees()) {
|
|
|
thirdCheck = new CheckModule();
|
|
|
- BeanUtils.copyProperties(treeTree,thirdCheck);
|
|
|
+ BeanUtils.copyProperties(treeTree, thirdCheck);
|
|
|
thirdCheck.setResType(treeTree.getId());
|
|
|
thirdCheckModules.add(thirdCheck);
|
|
|
|
|
@@ -140,35 +145,35 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.info("firstCheckModules:{}",JSON.toJSONString(firstCheckModules));
|
|
|
- log.info("secCheckModules:{}",JSON.toJSONString(secCheckModules));
|
|
|
- log.info("thirdCheckModules:{}",JSON.toJSONString(thirdCheckModules));
|
|
|
+ log.info("firstCheckModules:{}", JSON.toJSONString(firstCheckModules));
|
|
|
+ log.info("secCheckModules:{}", JSON.toJSONString(secCheckModules));
|
|
|
+ log.info("thirdCheckModules:{}", JSON.toJSONString(thirdCheckModules));
|
|
|
|
|
|
boolean b = saveBatch(firstCheckModules);
|
|
|
boolean b1 = saveBatch(secCheckModules);
|
|
|
boolean b2 = saveBatch(thirdCheckModules);
|
|
|
- log.info("b:{}",b);
|
|
|
- log.info("b1:{}",b1);
|
|
|
- log.info("b2:{}",b2);
|
|
|
+ log.info("b:{}", b);
|
|
|
+ log.info("b1:{}", b1);
|
|
|
+ log.info("b2:{}", b2);
|
|
|
|
|
|
return checkModules;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ModuleParam> getNodeData(String resType) {
|
|
|
- if (StringUtils.isEmpty(resType)){
|
|
|
+ if (StringUtils.isEmpty(resType)) {
|
|
|
throw new IllegalArgumentException(ErrorCode.ILLEGAL_ARGUMENT.getCode(), ErrorCode.ILLEGAL_ARGUMENT.getMessage());
|
|
|
}
|
|
|
// 根据resType值判断是什么资源库的数据,如果resType为-1则表示获取所有资源库的层级数据。
|
|
|
List<CheckModule> checkModules1 = new ArrayList<>();
|
|
|
- if ("-1".equals(resType)){
|
|
|
+ if ("-1".equals(resType)) {
|
|
|
// 查询所有资源库数据。
|
|
|
- checkModules1 = checkModuleMapper.selectList(new QueryWrapper<CheckModule>().lambda().eq(CheckModule::getParentId,"0"));
|
|
|
- }else {
|
|
|
+ checkModules1 = checkModuleMapper.selectList(new QueryWrapper<CheckModule>().lambda().eq(CheckModule::getParentId, "0"));
|
|
|
+ } else {
|
|
|
// 查询对应资源库数据。
|
|
|
checkModules1 = checkModuleMapper.selectList(new QueryWrapper<CheckModule>().lambda()
|
|
|
- .eq(CheckModule::getResType,resType)
|
|
|
- .eq(CheckModule::getParentId,"0"));
|
|
|
+ .eq(CheckModule::getResType, resType)
|
|
|
+ .eq(CheckModule::getParentId, "0"));
|
|
|
}
|
|
|
// 构建返回信息。一级数据。
|
|
|
ModuleParam moduleParam;
|
|
@@ -181,7 +186,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
List<ModuleData> childs = new ArrayList<>();
|
|
|
ModuleParam moduleParamChild;
|
|
|
List<CheckModule> checkModules2 = checkModuleMapper.selectList(new QueryWrapper<CheckModule>()
|
|
|
- .lambda().eq(CheckModule::getParentId,module.getId()));
|
|
|
+ .lambda().eq(CheckModule::getParentId, module.getId()));
|
|
|
for (CheckModule checkModule1 : checkModules2) {
|
|
|
moduleParamChild = new ModuleParam();
|
|
|
BeanUtils.copyProperties(checkModule1, moduleParamChild);
|
|
@@ -191,7 +196,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
ModuleParam moduleParamThird;
|
|
|
List<ModuleData> thirds = new ArrayList<>();
|
|
|
List<CheckModule> checkModules3 = checkModuleMapper.selectList(new QueryWrapper<CheckModule>()
|
|
|
- .lambda().eq(CheckModule::getParentId,checkModule1.getId()));
|
|
|
+ .lambda().eq(CheckModule::getParentId, checkModule1.getId()));
|
|
|
for (CheckModule checkModule2 : checkModules3) {
|
|
|
moduleParamThird = new ModuleParam();
|
|
|
BeanUtils.copyProperties(checkModule2, moduleParamThird);
|
|
@@ -202,13 +207,13 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
moduleParam.setTrees(childs);
|
|
|
moduleParams.add(moduleParam);
|
|
|
}
|
|
|
- log.info("******moduleParams:{}",JSON.toJSONString(moduleParams));
|
|
|
+ log.info("******moduleParams:{}", JSON.toJSONString(moduleParams));
|
|
|
return moduleParams;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ProvinceCityDistrict> getPCD(Integer pid) {
|
|
|
- return provinceCityDistrictMapper.selectList(new QueryWrapper<ProvinceCityDistrict>().lambda().eq(ProvinceCityDistrict::getPid,pid));
|
|
|
+ return provinceCityDistrictMapper.selectList(new QueryWrapper<ProvinceCityDistrict>().lambda().eq(ProvinceCityDistrict::getPid, pid));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -221,156 +226,324 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
public List addCategory() {
|
|
|
List<Category> categories = new ArrayList<>();
|
|
|
// 行业
|
|
|
- categories.add(initCategory("I1","电子信息","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I2","生物制药","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I3","航空航天","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I4","新材料","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I5","高技术服务","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I6","新能源与节能","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I7","资源与环境","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I8","先进制造与自动化","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I9","新能源汽车产业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I10","临空产业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I11","高端装备产业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I12","其他","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I13","医疗器械","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I14","磁性材料","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I15","生命健康","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I16","快递物流","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I17","农、林、牧、渔业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I18","采矿业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I19","制造业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I20","电力、热力、燃气及水生产和供应业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I21","建筑业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I22","批发业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I23","交通运输业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I24","住宿业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I25","信息传输业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I26","金融业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I27","房地产业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I28","租赁和商务服务业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I29","科学研究和技术服务业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I30","水利、环境和公共设施管理业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I31","居民服务、修理和其他服务业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I32","教育","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I33","卫生和社会工作","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I34","文化、体育和娱乐业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I35","公共管理、社会保障和社会组织","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I36","国际组织","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I37","工业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I38","零售业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I39","仓储业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I40","邮政业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I41","餐饮业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I42","软件和信息技术服务业","industry","601007","6","1","1"));
|
|
|
- categories.add(initCategory("I43","物业管理","industry","601007","6","1","1"));
|
|
|
+ categories.add(initCategory("I1", "电子信息", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I2", "生物制药", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I3", "航空航天", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I4", "新材料", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I5", "高技术服务", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I6", "新能源与节能", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I7", "资源与环境", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I8", "先进制造与自动化", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I9", "新能源汽车产业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I10", "临空产业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I11", "高端装备产业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I12", "其他", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I13", "医疗器械", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I14", "磁性材料", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I15", "生命健康", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I16", "快递物流", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I17", "农、林、牧、渔业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I18", "采矿业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I19", "制造业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I20", "电力、热力、燃气及水生产和供应业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I21", "建筑业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I22", "批发业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I23", "交通运输业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I24", "住宿业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I25", "信息传输业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I26", "金融业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I27", "房地产业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I28", "租赁和商务服务业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I29", "科学研究和技术服务业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I30", "水利、环境和公共设施管理业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I31", "居民服务、修理和其他服务业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I32", "教育", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I33", "卫生和社会工作", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I34", "文化、体育和娱乐业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I35", "公共管理、社会保障和社会组织", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I36", "国际组织", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I37", "工业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I38", "零售业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I39", "仓储业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I40", "邮政业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I41", "餐饮业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I42", "软件和信息技术服务业", "industry", "601007", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("I43", "物业管理", "industry", "601007", "6", "1", "1"));
|
|
|
|
|
|
// 八大领域high_field
|
|
|
- categories.add(initCategory("H1","电子信息技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H2","生物与新医药技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H3","航空航天技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H4","新材料技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H5","高技术服务业","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H6","新能源及节能技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H7","资源与环境技术","highField","602005","6","1","1"));
|
|
|
- categories.add(initCategory("H8","高新技术改造传统产业","highField","602005","6","1","1"));
|
|
|
+ categories.add(initCategory("F1", "电子信息技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F2", "生物与新医药技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F3", "航空航天技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F4", "新材料技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F5", "高技术服务业", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F6", "新能源及节能技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F7", "资源与环境技术", "highField", "602005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("F8", "高新技术改造传统产业", "highField", "602005", "6", "1", "1"));
|
|
|
|
|
|
// 学历:高中、中专、大专、学士、硕士、博士、博士后
|
|
|
- categories.add(initCategory("E1","高中","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E2","中专","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E3","大专","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E4","学士","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E5","硕士","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E6","博士","education","608015","6","1","1"));
|
|
|
- categories.add(initCategory("E7","博士后","education","608015","6","1","1"));
|
|
|
+ categories.add(initCategory("E1", "高中", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E2", "中专", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E3", "大专", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E4", "学士", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E5", "硕士", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E6", "博士", "education", "608015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("E7", "博士后", "education", "608015", "6", "1", "1"));
|
|
|
|
|
|
// 职称:正高、副高、中级、副级、无
|
|
|
- categories.add(initCategory("T1","正高","title","608024","6","1","1"));
|
|
|
- categories.add(initCategory("T2","副高","title","608024","6","1","1"));
|
|
|
- categories.add(initCategory("T3","中级","title","608024","6","1","1"));
|
|
|
- categories.add(initCategory("T4","副级","title","608024","6","1","1"));
|
|
|
- categories.add(initCategory("T5","无","title","608024","6","1","1"));
|
|
|
+ categories.add(initCategory("T1", "正高", "title", "608024", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("T2", "副高", "title", "608024", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("T3", "中级", "title", "608024", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("T4", "副级", "title", "608024", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("T5", "无", "title", "608024", "6", "1", "1"));
|
|
|
|
|
|
// 合作模式:技术转让、技术开发、技术服务、技术咨询、技术入股、引进人才、共建研发平台、其他
|
|
|
- categories.add(initCategory("C1","技术转让","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C2","技术开发","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C3","技术服务","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C4","技术咨询","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C5","技术入股","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C6","引进人才","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C7","共建研发平台","cooperationMode","606005","6","1","1"));
|
|
|
- categories.add(initCategory("C8","其他","cooperationMode","606005","6","1","1"));
|
|
|
+ categories.add(initCategory("H1", "技术转让", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H2", "技术开发", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H3", "技术服务", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H4", "技术咨询", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H5", "技术入股", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H6", "引进人才", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H7", "共建研发平台", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("H8", "其他", "cooperationMode", "606005", "6", "1", "1"));
|
|
|
|
|
|
// 需求类型:技术需求、人才需求、投融资需求、其他
|
|
|
- categories.add(initCategory("R1","技术需求","requirementType","*","6","1","1"));
|
|
|
- categories.add(initCategory("R2","人才需求","requirementType","*","6","1","1"));
|
|
|
- categories.add(initCategory("R3","投融资需求","requirementType","*","6","1","1"));
|
|
|
- categories.add(initCategory("R4","其他","requirementType","*","6","1","1"));
|
|
|
+ categories.add(initCategory("R1", "技术需求", "requirementType", "*", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("R2", "人才需求", "requirementType", "*", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("R3", "投融资需求", "requirementType", "*", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("R4", "其他", "requirementType", "*", "6", "1", "1"));
|
|
|
|
|
|
// 成熟度:正在研究、已有样品、通过小试、可以量产、techMaturity
|
|
|
- categories.add(initCategory("M1","正在研究","techMaturity","606006","6","1","1"));
|
|
|
- categories.add(initCategory("M2","已有样品","techMaturity","606006","6","1","1"));
|
|
|
- categories.add(initCategory("M3","通过小试","techMaturity","606006","6","1","1"));
|
|
|
- categories.add(initCategory("M4","可以量产","techMaturity","606006","6","1","1"));
|
|
|
+ categories.add(initCategory("M1", "正在研究", "techMaturity", "606006", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("M2", "已有样品", "techMaturity", "606006", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("M3", "通过小试", "techMaturity", "606006", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("M4", "可以量产", "techMaturity", "606006", "6", "1", "1"));
|
|
|
|
|
|
// 知识产权:发明专利、实用新型、外观设计、软件著作权、PCT
|
|
|
- categories.add(initCategory("Z1","发明专利","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z2","植物新品种","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z3","国家级农作物品种","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z4","国家新药","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z5","国家一级中药保护品种","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z6","集成电路布图设计专有权","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z7","实用新型专利","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z8","外观设计专利","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z9","软件著作权","intelType","605002","6","1","1"));
|
|
|
- categories.add(initCategory("Z10","PCT","intelType","605002","6","1","1"));
|
|
|
+ categories.add(initCategory("Z1", "发明专利", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z2", "植物新品种", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z3", "国家级农作物品种", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z4", "国家新药", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z5", "国家一级中药保护品种", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z6", "集成电路布图设计专有权", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z7", "实用新型专利", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z8", "外观设计专利", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z9", "软件著作权", "intelType", "605002", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Z10", "PCT", "intelType", "605002", "6", "1", "1"));
|
|
|
|
|
|
// 知识产权获得方式:有自主研发、 仅有受让、受赠和并购等obtainWay
|
|
|
- categories.add(initCategory("W1","有自主研发","obtainWay","605003","6","1","1"));
|
|
|
- categories.add(initCategory("W2","仅有受让、受赠和并购等","obtainWay","605003","6","1","1"));
|
|
|
+ categories.add(initCategory("W1", "有自主研发", "obtainWay", "605003", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("W2", "仅有受让、受赠和并购等", "obtainWay", "605003", "6", "1", "1"));
|
|
|
|
|
|
// 发明专利:发明、实用、植物、农作物、新药、中药、集成、外观、软件
|
|
|
|
|
|
// 公司类型:国有、集体、私营、股份制、联营、外商、港澳、股份合作、有限
|
|
|
- categories.add(initCategory("Q1","国有","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q2","集体","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q3","私营","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q4","股份制","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q5","联营","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q6","外商","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q7","港澳","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q8","股份合作","enterpriseType","601015","6","1","1"));
|
|
|
- categories.add(initCategory("Q9","有限","enterpriseType","601015","6","1","1"));
|
|
|
+ categories.add(initCategory("Q1", "国有", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q2", "集体", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q3", "私营", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q4", "股份制", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q5", "联营", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q6", "外商", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q7", "港澳", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q8", "股份合作", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("Q9", "有限", "enterpriseType", "601015", "6", "1", "1"));
|
|
|
|
|
|
|
|
|
// 机构类型:企业、高校、机构、园区、政府、其他 todo 需要修改parentid。
|
|
|
- categories.add(initCategory("O1","企业","resType","601016","6","1","1"));
|
|
|
- categories.add(initCategory("O2","高校","resType","601016","6","1","1"));
|
|
|
- categories.add(initCategory("O3","机构","resType","601016","6","1","1"));
|
|
|
- categories.add(initCategory("O4","园区","resType","601016","6","1","1"));
|
|
|
- categories.add(initCategory("O5","政府","resType","601016","6","1","1"));
|
|
|
- categories.add(initCategory("O6","其他","resType","601016","6","1","1"));
|
|
|
+ categories.add(initCategory("O1", "企业", "resType", "601016", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("O2", "高校", "resType", "601016", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("O3", "机构", "resType", "601016", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("O4", "园区", "resType", "601016", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("O5", "政府", "resType", "601016", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("O6", "其他", "resType", "601016", "6", "1", "1"));
|
|
|
|
|
|
// 政治面貌:团员、党员、群众
|
|
|
- categories.add(initCategory("P1","团员","politicalLandscape","608012","6","1","1"));
|
|
|
- categories.add(initCategory("P2","党员","politicalLandscape","608012","6","1","1"));
|
|
|
- categories.add(initCategory("P3","群众","politicalLandscape","608012","6","1","1"));
|
|
|
+ categories.add(initCategory("P1", "团员", "politicalLandscape", "608012", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("P2", "党员", "politicalLandscape", "608012", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("P3", "群众", "politicalLandscape", "608012", "6", "1", "1"));
|
|
|
|
|
|
// 人才认定级别: A(国内外顶尖人才和国家级领军人才) B(省级领军人才) C(市级领军人才) D(高级人才) E(中高级人才) F(紧缺人才) G
|
|
|
- categories.add(initCategory("L1","A","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L2","B","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L3","C","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L4","D","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L5","E","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L6","F","talentIdentificationLevel","608030","6","1","1"));
|
|
|
- categories.add(initCategory("L7","G","talentIdentificationLevel","608030","6","1","1"));
|
|
|
-
|
|
|
- categoryService.saveBatch(categories);
|
|
|
+ categories.add(initCategory("L1", "A", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L2", "B", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L3", "C", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L4", "D", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L5", "E", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L6", "F", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+ categories.add(initCategory("L7", "G", "talentIdentificationLevel", "608030", "6", "1", "1"));
|
|
|
+
|
|
|
+ Dic dic = Dic.builder()
|
|
|
+ .titleCode("esst")
|
|
|
+ .build();
|
|
|
+ List<Dic> dics = new ArrayList<>();
|
|
|
+ dics.add(dic);
|
|
|
+ dicService.saveOrUpdateBatch(dics);
|
|
|
+
|
|
|
+ boolean b = categoryService.saveOrUpdateBatch(categories);
|
|
|
+ log.info("b:{}", b);
|
|
|
return categories;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List allCategory(String parentId) {
|
|
|
+ if (StringUtils.isEmpty(parentId)) {
|
|
|
+ throw new IllegalArgumentException(ErrorCode.ILLEGAL_ARGUMENT.getCode(), ErrorCode.ILLEGAL_ARGUMENT.getMessage());
|
|
|
+ }
|
|
|
+ List<Category> categories = !"-1".equals(parentId) ? categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
|
+ .eq(Category::getParentId, parentId).groupBy(Category::getParentId)) : categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
|
+ .groupBy(Category::getParentId));
|
|
|
+ log.info("categories:{}", categories.size());
|
|
|
+ // 构造返回数据。
|
|
|
+ AllCategory allCategory;
|
|
|
+ List<AllCategory> allCategories = new ArrayList<>();
|
|
|
+ for (Category category : categories) {
|
|
|
+ allCategory = new AllCategory();
|
|
|
+ List<InitDataThird> initDataThirds = initDataThirdMapper.selectList(new QueryWrapper<InitDataThird>().lambda()
|
|
|
+ .eq(InitDataThird::getId, category.getParentId()));
|
|
|
+ if (initDataThirds.size() > 0) {
|
|
|
+ BeanUtils.copyProperties(initDataThirds.get(0), allCategory);
|
|
|
+ allCategory.setParentId(category.getParentId());
|
|
|
+ // 根据parentid查询列表。
|
|
|
+ List<Category> selCategories = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
|
+ .eq(Category::getParentId, category.getParentId()));
|
|
|
+ CategoryField categoryField;
|
|
|
+ // 构建类目二级列表。
|
|
|
+ List<CategoryField> categoryFields = new ArrayList<>();
|
|
|
+ for (Category selCategory : selCategories) {
|
|
|
+ categoryField = new CategoryField();
|
|
|
+ BeanUtils.copyProperties(selCategory, categoryField);
|
|
|
+ categoryFields.add(categoryField);
|
|
|
+ }
|
|
|
+ allCategory.setFields(categoryFields);
|
|
|
+ allCategories.add(allCategory);
|
|
|
+ }else {
|
|
|
+ // todo 用户自定义类目,暂时无法与数据进行关联。
|
|
|
+ BeanUtils.copyProperties(category, allCategory);
|
|
|
+ allCategory.setParentId(category.getParentId());
|
|
|
+ // 二级标签类目
|
|
|
+ CategoryField categoryField = new CategoryField();
|
|
|
+ List<CategoryField> categoryFields = new ArrayList<>();
|
|
|
+ BeanUtils.copyProperties(category, categoryField);
|
|
|
+ categoryFields.add(categoryField);
|
|
|
+ allCategory.setFields(categoryFields);
|
|
|
+ allCategories.add(allCategory);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return allCategories;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> modCategory(List<CategoryField> categoryFields) {
|
|
|
+ // 根据name查询是否已存在。
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ List<Category> categoryLists = new ArrayList<>();
|
|
|
+ for (CategoryField categoryField : categoryFields) {
|
|
|
+ List<Category> categories = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
|
|
|
+ .eq(Category::getName, categoryField.getName())
|
|
|
+ .eq(Category::getParentId, categoryField.getParentId()));
|
|
|
+ log.info("categories:{}", categories.size());
|
|
|
+ if (categories.size() > 0) {
|
|
|
+ System.err.println("> 0");
|
|
|
+ // 数据已存在,无需新增。
|
|
|
+ map = CommonUtils.resMap(ErrorCode.IS_RELATION_EXIST.getCode(), ErrorCode.IS_RELATION_EXIST.getMessage(), categories);
|
|
|
+ } else {
|
|
|
+ categoryLists.add(dealMod(categoryField));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("categoryLists:{}", JSON.toJSONString(categoryLists));
|
|
|
+ map.put("data", categoryLists);
|
|
|
+ // 新增或修改类目分类。
|
|
|
+ boolean b = categoryService.saveOrUpdateBatch(categoryLists);
|
|
|
+ log.info("add or mod b:{}",b);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean delCategory(List<String> ids) {
|
|
|
+ // if (CollectionUtils.isNotEmpty(ids)){
|
|
|
+ if(null != ids && !ids.isEmpty()){
|
|
|
+ // 存在id列表,进行删除操作。
|
|
|
+ int i = categoryMapper.deleteBatchIds(ids);
|
|
|
+ return i > 0 ? true : false;
|
|
|
+ }else {
|
|
|
+ // 不存在id列表,抛出异常。
|
|
|
+ throw new IllegalArgumentException(ErrorCode.ILLEGAL_ARGUMENT.getCode(), ErrorCode.ILLEGAL_ARGUMENT.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 原类目下新增或者用户自定义添加的类目。
|
|
|
+ *
|
|
|
+ * @param categoryField
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Category dealMod(CategoryField categoryField) {
|
|
|
+ Category tmpCategory = new Category();
|
|
|
+ // 新增:自定义的code怎么处理?同一类型下的code获取string的第一个。
|
|
|
+ log.info("for ***");
|
|
|
+ String parentId = "000000";
|
|
|
+ // 判断parentid
|
|
|
+ if (StringUtils.isNotEmpty(categoryField.getParentId())) {
|
|
|
+ parentId = categoryField.getParentId();
|
|
|
+ }
|
|
|
+ // 如果parentid不为空,则表示用户想在某个类目下进行新增。
|
|
|
+ List<Category> selByParentId = categoryMapper.selectList(new QueryWrapper<Category>().lambda().eq(Category::getParentId, parentId));
|
|
|
+ // 倒序排序,特殊处理Z10这种数据。 Z9 Z10
|
|
|
+ List<Integer> serialNumber = selByParentId
|
|
|
+ .stream()
|
|
|
+ .map(noSuffixKey -> Integer.valueOf(StringUtils.substring(noSuffixKey.getCode(), 1)))
|
|
|
+ .sorted(Comparator.reverseOrder())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ log.info("serialNumber:{}", JSON.toJSONString(serialNumber));
|
|
|
+ if (selByParentId.size() > 0) {
|
|
|
+ if (categoryField.getName().equals("其他3")) {
|
|
|
+ serialNumber.add(0, 44);
|
|
|
+ log.info("serialNumber add:{}", JSON.toJSONString(serialNumber));
|
|
|
+ }
|
|
|
+ Integer number = serialNumber.get(0);
|
|
|
+ System.out.println(number);
|
|
|
+ String selStr = StringUtils.substring(selByParentId.get(0).getCode(), 0, 1);
|
|
|
+ System.err.println(selStr);
|
|
|
+ Integer tmpCode = number + 1;
|
|
|
+ String code = selStr + tmpCode;
|
|
|
+ System.err.println("code:" + code);
|
|
|
+ // 单独处理,用户自定义的情况。
|
|
|
+ if ("000000".equals(parentId)) {
|
|
|
+ // 用户自定义:
|
|
|
+ // 在原类目下新增
|
|
|
+ categoryField.setParentId(parentId);
|
|
|
+ BeanUtils.copyProperties(categoryField, tmpCategory);
|
|
|
+ tmpCategory.setCatCode("custom");
|
|
|
+ tmpCategory.setModuleId("0");
|
|
|
+ tmpCategory.setCode(code);
|
|
|
+ } else {
|
|
|
+ // 在原类目下新增
|
|
|
+ categoryField.setParentId(parentId);
|
|
|
+ BeanUtils.copyProperties(categoryField, tmpCategory);
|
|
|
+ tmpCategory.setCode(code);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ("000000".equals(parentId) && selByParentId.size() == 0) {
|
|
|
+ // 用户自定义:
|
|
|
+ tmpCategory = initCategory("C1", categoryField.getName(), "custom", "000000",
|
|
|
+ "0", "1", "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tmpCategory;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * [
|
|
|
+ * {
|
|
|
+ * "code": "T6",
|
|
|
+ * "name": "其他",
|
|
|
+ * "catCode": "title",
|
|
|
+ * "parentId": "608024"
|
|
|
+ * }
|
|
|
+ * ]
|
|
|
+ */
|
|
|
+
|
|
|
/**
|
|
|
* 初始化类目/标签库。
|
|
|
+ *
|
|
|
* @param code
|
|
|
* @param name
|
|
|
* @param catCode
|
|
@@ -380,7 +553,7 @@ public class CheckModuleServiceImpl extends ServiceImpl<CheckModuleMapper, Check
|
|
|
* @param isEnabled
|
|
|
* @return
|
|
|
*/
|
|
|
- public Category initCategory(String code,String name,String catCode,String parentId,String moduleId,String categoryType,String isEnabled){
|
|
|
+ public Category initCategory(String code, String name, String catCode, String parentId, String moduleId, String categoryType, String isEnabled) {
|
|
|
Category category = Category.builder()
|
|
|
.code(code)
|
|
|
.name(name)
|