|
|
@@ -33,7 +33,8 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
|
|
|
@Override
|
|
|
public List<KnowledgeVO> getAllKnowledgeAndWeight() {
|
|
|
- List<KnowledgeOnPositionDao> knowledgeOnPositionDaos = knowledgeRepository.findAllInfo();
|
|
|
+ List knowledgeOnPositionList = knowledgeRepository.findAllInfo();
|
|
|
+ ArrayList<KnowledgeOnPositionDao> knowledgeOnPositionDaos = objectToDao(knowledgeOnPositionList);
|
|
|
ArrayList<KnowledgeVO> knowledgeVOS = new ArrayList<>();
|
|
|
KnowledgeVO knowledgeVO = null;
|
|
|
if(knowledgeOnPositionDaos.size()>0)
|
|
|
@@ -50,9 +51,31 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
knowledgeVO = new KnowledgeVO(knowledgeOnPositionDaos.get(i));
|
|
|
}
|
|
|
}
|
|
|
+ System.out.println();
|
|
|
return knowledgeVOS;
|
|
|
}
|
|
|
|
|
|
+ private ArrayList<KnowledgeOnPositionDao> objectToDao(List knowledgeOnPositionList) {
|
|
|
+ ArrayList<KnowledgeOnPositionDao> ans = new ArrayList<>();
|
|
|
+ for(int i=0;i<knowledgeOnPositionList.size();i++){
|
|
|
+ Object[] tempDaos = (Object[]) knowledgeOnPositionList.get(i);
|
|
|
+ if(tempDaos.length>10)
|
|
|
+ ans.add(KnowledgeOnPositionDao.builder()
|
|
|
+ .id(Integer.valueOf(tempDaos[0].toString()))
|
|
|
+ .name(tempDaos[1].toString())
|
|
|
+ .nameEng(tempDaos[2].toString())
|
|
|
+ .abbreviation(tempDaos[3].toString())
|
|
|
+ .parentId(Integer.valueOf(tempDaos[4].toString()))
|
|
|
+ .parentName(tempDaos[5].toString())
|
|
|
+ .pid(Integer.valueOf(tempDaos[6].toString()))
|
|
|
+ .uid(Integer.valueOf(tempDaos[7].toString()))
|
|
|
+ .isleaf(Integer.valueOf(tempDaos[8].toString()))
|
|
|
+ .position(tempDaos[9]==null?"":tempDaos[9].toString())
|
|
|
+ .weight(tempDaos[10]==null?0:Double.valueOf(tempDaos[10].toString())).build());
|
|
|
+ }
|
|
|
+ return ans;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public KnowledgeVO updatePositionWeight(KnowledgeVO knowledgeVO) {
|
|
|
Map<String,Double> positonWeight = knowledgeVO.getWeightOnPosition();
|