|
@@ -11,7 +11,7 @@ import com.persagy.common.web.PagedResponse;
|
|
|
import com.persagy.dmp.rwd.entity.*;
|
|
|
import com.persagy.dmp.rwd.enums.FuncidDataType;
|
|
|
import com.persagy.dmp.rwd.enums.ObjType;
|
|
|
-import com.persagy.dmp.rwd.model.ClassDefModel;
|
|
|
+import com.persagy.dmp.rwd.model.ClassDefWdModel;
|
|
|
import com.persagy.dmp.rwd.model.FuncidDefModel;
|
|
|
import com.persagy.dmp.rwd.repository.ClassDefWdRepository;
|
|
|
import com.persagy.dmp.rwd.util.ClassCodeUtils;
|
|
@@ -41,8 +41,8 @@ public class ClassDefService extends BaseService {
|
|
|
@Autowired
|
|
|
private ClassCodeUtils classCodeUtils;
|
|
|
|
|
|
- public ListResponse<ClassDefModel> queryClass(String groupCode, String schemaId, String projectId, String appId, Boolean subFlag, JacksonCriteria criteria) {
|
|
|
- ListResponse<ClassDefModel> resp = new ListResponse<>();
|
|
|
+ public ListResponse<ClassDefWdModel> queryClass(String groupCode, String schemaId, String projectId, String appId, Boolean subFlag, JacksonCriteria criteria) {
|
|
|
+ ListResponse<ClassDefWdModel> resp = new ListResponse<>();
|
|
|
OrgParam orgParam = prepareParam(resp);
|
|
|
if (!resp.success()) {
|
|
|
return resp;
|
|
@@ -70,7 +70,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Map<String, ClassDefModel> map = new HashMap<>();
|
|
|
+ Map<String, ClassDefWdModel> map = new HashMap<>();
|
|
|
// 查询平台级
|
|
|
JacksonCriteria jacksonCriteria = JacksonCriteria.newInstance();
|
|
|
jacksonCriteria.getCriteria().setAll(criteria.getCriteria());
|
|
@@ -78,8 +78,8 @@ public class ClassDefService extends BaseService {
|
|
|
jacksonCriteria.add("groupCode", "0");
|
|
|
jacksonCriteria.setWithoutCount(true);
|
|
|
setSharding("0", "0"); // sharding
|
|
|
- PagedResponse<ClassDefModel> queryResponse = query(jacksonCriteria);
|
|
|
- for (ClassDefModel model : queryResponse.getData()) {
|
|
|
+ PagedResponse<ClassDefWdModel> queryResponse = query(jacksonCriteria);
|
|
|
+ for (ClassDefWdModel model : queryResponse.getData()) {
|
|
|
map.put(model.getCode(), model);
|
|
|
}
|
|
|
|
|
@@ -92,7 +92,7 @@ public class ClassDefService extends BaseService {
|
|
|
jacksonCriteria.setWithoutCount(true);
|
|
|
setSharding(orgParam.groupCode, "0"); // sharding
|
|
|
queryResponse = query(groupCriteria);
|
|
|
- for (ClassDefModel model : queryResponse.getData()) {
|
|
|
+ for (ClassDefWdModel model : queryResponse.getData()) {
|
|
|
map.put(model.getCode(), model);
|
|
|
}
|
|
|
}
|
|
@@ -107,7 +107,7 @@ public class ClassDefService extends BaseService {
|
|
|
jacksonCriteria.setWithoutCount(true);
|
|
|
setSharding(orgParam.groupCode, orgParam.projectId); // sharding
|
|
|
queryResponse = query(jacksonCriteria);
|
|
|
- for (ClassDefModel model : queryResponse.getData()) {
|
|
|
+ for (ClassDefWdModel model : queryResponse.getData()) {
|
|
|
map.put(model.getCode(), model);
|
|
|
}
|
|
|
}
|
|
@@ -124,9 +124,9 @@ public class ClassDefService extends BaseService {
|
|
|
|
|
|
if (classCodes.size() > 0) {
|
|
|
// 方案有订阅, 去除未订阅的内容
|
|
|
- Iterator<Map.Entry<String, ClassDefModel>> iterator = map.entrySet().iterator();
|
|
|
+ Iterator<Map.Entry<String, ClassDefWdModel>> iterator = map.entrySet().iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
- Map.Entry<String, ClassDefModel> next = iterator.next();
|
|
|
+ Map.Entry<String, ClassDefWdModel> next = iterator.next();
|
|
|
if (!classCodes.contains(next.getKey())) {
|
|
|
iterator.remove();
|
|
|
}
|
|
@@ -146,9 +146,9 @@ public class ClassDefService extends BaseService {
|
|
|
|
|
|
if (classCodes.size() > 0) {
|
|
|
// 方案有订阅, 去除未订阅的内容
|
|
|
- Iterator<Map.Entry<String, ClassDefModel>> iterator = map.entrySet().iterator();
|
|
|
+ Iterator<Map.Entry<String, ClassDefWdModel>> iterator = map.entrySet().iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
- Map.Entry<String, ClassDefModel> next = iterator.next();
|
|
|
+ Map.Entry<String, ClassDefWdModel> next = iterator.next();
|
|
|
if (!classCodes.contains(next.getKey())) {
|
|
|
iterator.remove();
|
|
|
}
|
|
@@ -160,7 +160,7 @@ public class ClassDefService extends BaseService {
|
|
|
if (subFlag && map.size() > 0) {
|
|
|
|
|
|
//List<FuncidDataType> enumTypeList = Arrays.asList(FuncidDataType.ENUM);
|
|
|
- List<String> classCodeList = map.values().stream().map(ClassDefModel::getCode).collect(Collectors.toList());
|
|
|
+ List<String> classCodeList = map.values().stream().map(ClassDefWdModel::getCode).collect(Collectors.toList());
|
|
|
JacksonCriteria funcidCriteria = JacksonCriteria.newInstance();
|
|
|
funcidCriteria.add("classCode").in(classCodeList);
|
|
|
funcidCriteria.add("dataType", FuncidDataType.ENUM);
|
|
@@ -174,7 +174,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
|
|
|
String classCode = funcid.getClassCode();
|
|
|
- ClassDefModel classDefModel = map.get(classCode);
|
|
|
+ ClassDefWdModel classDefModel = map.get(classCode);
|
|
|
if (classDefModel == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -185,7 +185,7 @@ public class ClassDefService extends BaseService {
|
|
|
|
|
|
for (JsonNode jsonNode : dataSource) {
|
|
|
ObjectNode item = (ObjectNode) jsonNode;
|
|
|
- ClassDefModel model = new ClassDefModel();
|
|
|
+ ClassDefWdModel model = new ClassDefWdModel();
|
|
|
BeanUtils.copyProperties(classDefModel, model);
|
|
|
model.setCode(classDefModel.getCode() + "&" + funcid.getCode() + "=" + item.get("code").asText());
|
|
|
model.setName(classDefModel.getName() + "-" + item.get("name").asText());
|
|
@@ -198,7 +198,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
|
|
|
//
|
|
|
- List<ClassDefModel> data = new ArrayList<>(map.size());
|
|
|
+ List<ClassDefWdModel> data = new ArrayList<>(map.size());
|
|
|
data.addAll(map.values());
|
|
|
resp.setData(data);
|
|
|
return resp;
|
|
@@ -213,14 +213,14 @@ public class ClassDefService extends BaseService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public PagedResponse<ClassDefModel> query(JacksonCriteria criteria) {
|
|
|
+ public PagedResponse<ClassDefWdModel> query(JacksonCriteria criteria) {
|
|
|
PagedResponse<ClassDefWd> resp = criteriaUtils.query(QClassDefWd.classDefWd, this::parse, criteria);
|
|
|
- PagedResponse<ClassDefModel> result = new PagedResponse<>();
|
|
|
+ PagedResponse<ClassDefWdModel> result = new PagedResponse<>();
|
|
|
result.setCount(resp.getCount());
|
|
|
List<ClassDefWd> dataList = resp.getData();
|
|
|
if (dataList != null && dataList.size() > 0) {
|
|
|
- List<ClassDefModel> collect = dataList.stream().map(entity -> {
|
|
|
- ClassDefModel model = entity.toModel();
|
|
|
+ List<ClassDefWdModel> collect = dataList.stream().map(entity -> {
|
|
|
+ ClassDefWdModel model = entity.toModel();
|
|
|
return model;
|
|
|
}).collect(Collectors.toList());
|
|
|
result.setData(collect);
|
|
@@ -229,7 +229,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public MapResponse create(ClassDefModel param) {
|
|
|
+ public MapResponse create(ClassDefWdModel param) {
|
|
|
MapResponse response = new MapResponse();
|
|
|
// TODO
|
|
|
ClassDefWd entity = ClassDefWd.fromModel(param);
|
|
@@ -238,7 +238,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public MapResponse update(ClassDefModel param) {
|
|
|
+ public MapResponse update(ClassDefWdModel param) {
|
|
|
MapResponse response = new MapResponse();
|
|
|
// TODO
|
|
|
ClassDefWd entity = ClassDefWd.fromModel(param);
|
|
@@ -247,7 +247,7 @@ public class ClassDefService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public MapResponse delete(ClassDefModel param) {
|
|
|
+ public MapResponse delete(ClassDefWdModel param) {
|
|
|
MapResponse response = new MapResponse();
|
|
|
// TODO
|
|
|
return response;
|