| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class CodeDataMainPanelDataProvider extends AbstractVCIJTableDataProvider<BaseModel> { |
| | | private CodeDataMainPanel ownerPanel; |
| | |
| | | LinkedList<String> nameList = new LinkedList<>(); |
| | | LinkedList<String> fieldList = new LinkedList<>(); |
| | | List<CodeShowFieldConfigVO> colsList=ownerPanel.getUiFormRefer().getCodeShowFieldConfigVOS(); |
| | | colsList.stream().forEach(columns->{ |
| | | for (CodeShowFieldConfigVO columns : colsList) { |
| | | String title= columns.getTitle(); |
| | | String field=columns.getField(); |
| | | nameList.add(title); |
| | | fieldList.add(field); |
| | | }); |
| | | } |
| | | specialColumns = nameList.toArray(new String[]{}); |
| | | fields = fieldList.toArray(new String[]{}); |
| | | return specialColumns; |
| | |
| | | VCIJTableNode<BaseModel> res = new VCIJTableNode<BaseModel>(model); |
| | | int i=dataColumnStartIndex; |
| | | for (String field:fields){ |
| | | String data=defaultDataMap.getOrDefault(field,""); |
| | | String data=defaultDataMap.containsKey(field) ? defaultDataMap.get(field) : "" ; |
| | | res.setPropertyValue(getColumns()[i++], data); |
| | | } |
| | | return res; |
| | |
| | | List<CodeSrchCondConfigVO> codeSrchCondConfigVOS=uiFormRefer.getCodeSrchCondConfigVOS(); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | if(!CollectionUtils.isEmpty(codeSrchCondConfigVOS)){ |
| | | codeSrchCondConfigVOS.stream().forEach(codeSrchCondConfigVO -> { |
| | | for (CodeSrchCondConfigVO codeSrchCondConfigVO : codeSrchCondConfigVOS) { |
| | | String field=codeSrchCondConfigVO.getFilterField(); |
| | | String value=codeSrchCondConfigVO.getFilterValue(); |
| | | String filterType= codeSrchCondConfigVO.getFilterType(); |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | } |
| | | } |
| | | Map<String, String> customCondtionMap=ownerPanel.getCustomCondtionMap(); |
| | | if(customCondtionMap!=null&&customCondtionMap.size()>0){ |
| | | customCondtionMap.forEach((field, value) -> { |
| | | condtionMap.put("conditionMap["+field+"]",value); |
| | | }); |
| | | |
| | | for(String field : customCondtionMap.keySet()){ |
| | | condtionMap.put("conditionMap["+field+"]",customCondtionMap.get(field)); |
| | | } |
| | | } |
| | | Map<String,String> headerMap=new HashMap<>(); |
| | | headerMap.put("Blade-Auth",this.ownerPanel.getTokenUserObject().getAccess_token()); |
| | |
| | | List dataList= iPage.getRecords(); |
| | | BaseModel [] baseModels=new BaseModel[]{}; |
| | | if(!CollectionUtils.isEmpty(dataList)) { |
| | | List<BaseModel> hostInfos = (List<BaseModel>) dataList.stream().map(entity -> JSONUtil.toBean(JSONUtil.parseObj(entity), BaseModel.class)).collect(Collectors.toList()); |
| | | List<BaseModel> hostInfos = new ArrayList<>(); |
| | | for (Object entity : dataList) { |
| | | hostInfos.add(JSONUtil.toBean(JSONUtil.parseObj(entity),BaseModel.class)); |
| | | } |
| | | baseModels = hostInfos.toArray(new BaseModel[]{}); |
| | | } |
| | | return baseModels; |